Skip to content

Run phpunit with --coverage-text/html got Error: Undefined variable: matchIP #363

Description

@samsonasik

Here is the output:

$ export DB=mysqli && vendor/bin/phpunit --coverage-text
PHPUnit 5.3.5 by Sebastian Bergmann and contributors.

.............................................................   61 / 1191 (  5%)
.............................................................  122 / 1191 ( 10%)
.............................................................  183 / 1191 ( 15%)
.............................................................  244 / 1191 ( 20%)
.............................................................  305 / 1191 ( 25%)
.............................................................  366 / 1191 ( 30%)
.............................................................  427 / 1191 ( 35%)
.............................................................  488 / 1191 ( 40%)
.............................................................  549 / 1191 ( 46%)
.............................................................  610 / 1191 ( 51%)
.............................................................  671 / 1191 ( 56%)
.............................................................  732 / 1191 ( 61%)
.............................................................  793 / 1191 ( 66%)
.............................................................  854 / 1191 ( 71%)
.............................................................  915 / 1191 ( 76%)
.............................................................  976 / 1191 ( 81%)
............................................................. 1037 / 1191 ( 87%)
............................................................. 1098 / 1191 ( 92%)
............................................................. 1159 / 1191 ( 97%)
................................                              1191 / 1191 (100%)

Time: 41.93 seconds, Memory: 40.00MB

OK (1191 tests, 1877 assertions)
@php

use CodeIgniter\Database\Migration;

class Migration_create_sessions_table extends Migration
{
    public function up()
    {
        $this->forge->addField([
            'id'         => ['type' => 'INT', 'constraint' => 9, 'unsigned' => true, 'auto_increment' => true],
            'ip_address' => ['type' => 'VARCHAR', 'constraint' => 45, 'null' => false],
            'timestamp'  => ['type' => 'INT', 'constraint' => 10, 'unsigned' => true, 'null' => false, 'default' => 0],
            'data'       => ['type' => 'text', 'null' => false, 'default' => ''],
        ]);

    
An uncaught Exception was encountered

Type:        ErrorException
Message:     Undefined variable: matchIP
Filename:    /Users/samsonasik/www/CodeIgniter4/system/Commands/Sessions/Views/migration.tpl.php
Line Number: 16

	Backtrace:
			-16 - /Users/samsonasik/www/CodeIgniter4/system/Commands/Sessions/Views/migration.tpl.php::errorHandler
					-735 - /Users/samsonasik/www/CodeIgniter4/vendor/phpunit/php-code-coverage/src/CodeCoverage.php::include_once
					-708 - /Users/samsonasik/www/CodeIgniter4/vendor/phpunit/php-code-coverage/src/CodeCoverage.php::processUncoveredFileFromWhitelist
					-182 - /Users/samsonasik/www/CodeIgniter4/vendor/phpunit/php-code-coverage/src/CodeCoverage.php::addUncoveredFilesFromWhitelist
					-25 - /Users/samsonasik/www/CodeIgniter4/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/Factory.php::getData
					-146 - /Users/samsonasik/www/CodeIgniter4/vendor/phpunit/php-code-coverage/src/CodeCoverage.php::create
					-57 - /Users/samsonasik/www/CodeIgniter4/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/Text.php::getReport
					-547 - /Users/samsonasik/www/CodeIgniter4/vendor/phpunit/phpunit/src/TextUI/TestRunner.php::process
					-159 - /Users/samsonasik/www/CodeIgniter4/vendor/phpunit/phpunit/src/TextUI/Command.php::doRun
					-110 - /Users/samsonasik/www/CodeIgniter4/vendor/phpunit/phpunit/src/TextUI/Command.php::run
					-47 - /Users/samsonasik/www/CodeIgniter4/vendor/phpunit/phpunit/phpunit::main

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions