本文整理汇总了PHP中Doctrine\Common\DataFixtures\Loader::isTransient方法的典型用法代码示例。如果您正苦于以下问题:PHP Loader::isTransient方法的具体用法?PHP Loader::isTransient怎么用?PHP Loader::isTransient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\Common\DataFixtures\Loader
的用法示例。
在下文中一共展示了Loader::isTransient方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testLoader
public function testLoader()
{
$loader = new Loader();
$loader->addFixture($this->getMock('Doctrine\\Common\\DataFixtures\\FixtureInterface'), array(), array(), 'Mock1');
$loader->addFixture($this->getMock('Doctrine\\Common\\DataFixtures\\FixtureInterface', array(), array(), 'Mock2'));
$loader->addFixture($this->getMock('Doctrine\\Common\\DataFixtures\\SharedFixtureInterface', array(), array(), 'Mock3'));
$this->assertEquals(3, count($loader->getFixtures()));
$loader->loadFromDirectory(__DIR__ . '/TestFixtures');
$this->assertEquals(7, count($loader->getFixtures()));
$this->assertTrue($loader->isTransient('TestFixtures\\NotAFixture'));
$this->assertFalse($loader->isTransient('TestFixtures\\MyFixture1'));
}
示例2: testLoader
public function testLoader()
{
$loader = new Loader();
$loader->addFixture($this->getMock('Doctrine\Common\DataFixtures\FixtureInterface'));
$loader->addFixture($this->getMock('Doctrine\Common\DataFixtures\FixtureInterface'));
$this->assertEquals(2, count($loader->getFixtures()));
$loader->loadFromDirectory(__DIR__.'/TestFixtures');
$this->assertEquals(4, count($loader->getFixtures()));
$this->assertTrue($loader->isTransient('TestFixtures\NotAFixture'));
$this->assertFalse($loader->isTransient('TestFixtures\MyFixture1'));
}
示例3: testLoadFromFile
public function testLoadFromFile()
{
$loader = new Loader();
$loader->addFixture($this->getMock('Doctrine\\Common\\DataFixtures\\FixtureInterface'), array(), array(), 'Mock1');
$loader->addFixture($this->getMock('Doctrine\\Common\\DataFixtures\\FixtureInterface', array(), array(), 'Mock2'));
$loader->addFixture($this->getMock('Doctrine\\Common\\DataFixtures\\SharedFixtureInterface', array(), array(), 'Mock3'));
$this->assertCount(3, $loader->getFixtures());
$loader->loadFromFile(__DIR__ . '/TestFixtures/MyFixture1.php');
$this->assertCount(4, $loader->getFixtures());
$loader->loadFromFile(__DIR__ . '/TestFixtures/NotAFixture.php');
$this->assertCount(4, $loader->getFixtures());
$loader->loadFromFile(__DIR__ . '/TestFixtures/MyFixture2.php');
$this->assertCount(5, $loader->getFixtures());
$this->assertTrue($loader->isTransient('TestFixtures\\NotAFixture'));
$this->assertFalse($loader->isTransient('TestFixtures\\MyFixture1'));
}
示例4: testLoadFromFile
public function testLoadFromFile()
{
$loader = new Loader();
$loader->addFixture($this->getMockBuilder(FixtureInterface::class)->setMockClassName('Mock1')->getMock());
$loader->addFixture($this->getMockBuilder(FixtureInterface::class)->setMockClassName('Mock2')->getMock());
$loader->addFixture($this->getMockBuilder(SharedFixtureInterface::class)->setMockClassName('Mock3')->getMock());
$this->assertCount(3, $loader->getFixtures());
$loader->loadFromFile(__DIR__ . '/TestFixtures/MyFixture1.php');
$this->assertCount(4, $loader->getFixtures());
$loader->loadFromFile(__DIR__ . '/TestFixtures/NotAFixture.php');
$this->assertCount(4, $loader->getFixtures());
$loader->loadFromFile(__DIR__ . '/TestFixtures/MyFixture2.php');
$this->assertCount(5, $loader->getFixtures());
$this->assertTrue($loader->isTransient('TestFixtures\\NotAFixture'));
$this->assertFalse($loader->isTransient('TestFixtures\\MyFixture1'));
}