| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php
- /**
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * For full copyright and license information, please see the LICENSE.txt
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
- * @link http://cakephp.org CakePHP(tm) Project
- * @since 3.0.0
- * @license http://www.opensource.org/licenses/mit-license.php MIT License
- */
- namespace Cake\Test\TestSuite;
- use Cake\Core\Plugin;
- use Cake\Database\ConnectionManager;
- use Cake\TestSuite\Fixture\FixtureManager;
- use Cake\TestSuite\TestCase;
- /**
- * Fixture manager test case.
- */
- class FixtureManagerTest extends TestCase {
- /**
- * Setup method
- *
- * @return void
- */
- public function setUp() {
- parent::setUp();
- $this->manager = new FixtureManager();
- }
- /**
- * Test loading core fixtures.
- *
- * @return void
- */
- public function testFixturizeCore() {
- $test = $this->getMock('Cake\TestSuite\TestCase');
- $test->fixtures = ['core.article'];
- $this->manager->fixturize($test);
- $fixtures = $this->manager->loaded();
- $this->assertCount(1, $fixtures);
- $this->assertArrayHasKey('core.article', $fixtures);
- $this->assertInstanceOf('Cake\Test\Fixture\ArticleFixture', $fixtures['core.article']);
- }
- /**
- * Test loading app fixtures.
- *
- * @return void
- */
- public function testFixturizePlugin() {
- Plugin::load('TestPlugin');
- $test = $this->getMock('Cake\TestSuite\TestCase');
- $test->fixtures = ['plugin.test_plugin.article'];
- $this->manager->fixturize($test);
- $fixtures = $this->manager->loaded();
- $this->assertCount(1, $fixtures);
- $this->assertArrayHasKey('plugin.test_plugin.article', $fixtures);
- $this->assertInstanceOf(
- 'TestPlugin\Test\Fixture\ArticleFixture',
- $fixtures['plugin.test_plugin.article']
- );
- }
- }
|