Yii2 fixtures not unloading, not loading with dependencies
<p><strong>Unloading issue</strong></p>

<p>I'm trying to create fixtures in Yii2 to be able to fill my tables with some test data. I'm not using Codeception yet. I'm following the <a href="http://www.yiiframework.com/doc-2.0/guide-test-fixtures.html" rel="nofollow">Yii2 guide</a> on fixtures. The first table is the User table:</p>

<pre><code>namespace tests\unit\fixtures;

use yii\test\ActiveFixture;
/**
* User fixture
*/
class UserFixture extends ActiveFixture
{
    public $modelClass = 'common\models\User';
}
</code></pre>

<p>This one works when I ssh into Vagrant and load the fixture, but the entries are still there after I do an unload. According to the terminal output the fixture was successfully unloaded. What am I missing here? Should this work out of the box or should you create your own unload function?</p>

<p>Edit:
What did help was adding this to the User fixture:</p>

<pre><code>public function unload(){
    parent::unload();
    $this-&gt;resetTable();
}
</code></pre>

<p>I would expect this to be present in unload anyhow, but I have read the (very slow) discussion in the link posted below. I don't know if the parent::unload() line was necessary, it worked without the line, but BaseActiveFixture defines it and empties $this->data and $this->_models.</p>

<p><strong>Depends issue</strong></p>

<p>My second fixture depends on the User fixture:</p>

<pre><code>namespace tests\unit\fixtures;

use yii\test\ActiveFixture;

/**
 * User Libraries fixture
 */
class UserLibrariesFixture extends ActiveFixture
{
    public $modelClass = 'common\models\UserLibraries';

    // Dependencies
    public $depends = [
        'tests\unit\fixtures\UserFixture',
    ];
}
</code></pre>

<p>This one also loads correctly according to the terminal, but the UserLibraries table remains empty. It doesn't say it will load the dependencies, but I don't know if it should say that it will. </p>

<p>I've kept the data files as simple as possible and the correct data appears in the User table. I only added data for the required fields for the UserLibraries table, so I don't know if that could be an issue. Is there a log file that I can check for entries regarding the fixtures?</p>

<p>Edit: 
The UserLibraries fixture is now able to create data in the User table (but not the UserLibraries table), so disabling the foreign key check works for fixtures with dependencies. That makes me think there is an error in my data file for the UserLibraries. To check that I need a log file.</p>

<p>Edit2:
<strong>Fixture loading issue solution</strong></p>

<p>The fixtures would not load because of an underscore in the table names. The table names userLibraries and user_libraries will result in model, controller and view files with identical file names when created with Gii. With the camelcase name table I am able to load fixtures.</p>