Commit 0e7de3e3 by Qiang Xue

removed trash code.

parent 2dec35cf
......@@ -68,61 +68,3 @@ class Fixture extends Component
}
}
class TestCase extends \Codeception\TestCase\Test
{
public $fixtures;
protected function setUp()
{
parent::setUp();
$this->mockApplication();
$this->loadFixtures();
}
protected function tearDown()
{
$this->unloadFixtures();
$this->destroyApplication();
parent::tearDown();
}
protected function getFixture($name)
{
// return the named fixture object
}
public function fixtures()
{
return [
// anonymous fixture
PostFixture::className(),
// "users" fixture
'users' => UserFixture::className(),
// "cache" fixture with configuration
'cache' => [
'class' => CacheFixture::className(),
'host' => 'xxx',
],
];
}
public function testSave()
{
$user = $this->getFixture('users')->getModel('user1');
$rows = $this->getFixture('users')->getRows();
// or support magic property like the following:
$user = $this->users->getModel('user1');
}
}
class UserFixture extends DbFixture
{
public $modelClass = 'app\models\User';
protected function loadData($table)
{
return require(__DIR__ . '/' . $table->name . '.php');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment