$ ../vendor/bin/codecept run codeception/unit/models/MemberTest.php
Codeception PHP Testing Framework v2.0.16
Powered by PHPUnit 4.7.7 by Sebastian Bergmann and contributors.
←[1mUnit Tests (0) ←[22m------------------------------
---------------------------------------------
Time: 2.99 seconds, Memory: 10.25Mb
←[30;43mNo tests executed!←[0m
I am getting [1m and 30;43m, but I have no idea what they mean, unless they're some debug output that are basically meaningless.
Not sure what's wrong. I mean if there's something that went wrong, they should be more explicit. Here's my MemberTest class:
<?php
namespace tests\codeception\unit\models;
use yii\codeception\TestCase;
use app\models\Member;
class MemberTest extends TestCase {
public function basicTest()
{
$John = Member::findOne(['nickname'=>'John']);
$this->assertNotNull($John);
}
public function fixtures()
{
return [
'members' => 'app\tests\codeception\fictures\MemberFixture'
];
}
}
I also made a fixture class, MemberFixture:
<?php
namespace app\tests\codeception\fixtures;
use yii\test\ActiveFixture;
class MemberFixture extends ActiveFixture
{
public $modelClass = 'app\models\Member';
}
And a data class member:
<?php
return [
[
'id' => 1,
'firstName' => 'John',
'lastName' => 'Bush',
'email' => '[email protected]',
'username' => 'Warmonger',
'password' => 'allo',
],
[
'id' => 2,
'firstName' => 'Jane',
'lastName' => 'Bush',
'email' => '[email protected]',
'username' => 'PluckedFlower',
'password' => 'allo',
],
];
I also ran codecept build after changing the unit.suite.yml file:
# Codeception Test Suite Configuration
# suite for unit (internal) tests.
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
class_name: UnitTester
modules:
enabled:
- Asserts
I have no idea what's wrong. I am using Yii2 in case you haven't figured it out yet. I changed the Member class and tested it out by inserting Member elements with the form and everything to make sure my models and controllers worked fine, so I am completely clueless here.
←[30;43mand the like are shell colour codes, you appear to be using a terminal that does not support colours.