diff --git a/composer.json b/composer.json index 00c65da..665bc29 100644 --- a/composer.json +++ b/composer.json @@ -20,8 +20,7 @@ "fzaninotto/faker": "~1.1", "doctrine/common": "~2.0", "jamesmoss/toml": "*", - "symfony/expression-language": "~2.4", - "webmozart/puli": "~1.0@alpha" + "symfony/expression-language": "~2.4" }, "suggest": { "symfony/yaml" : "~2.0", @@ -31,8 +30,7 @@ "doctrine/orm": "~2.0", "doctrine/mongodb-odm": "@beta", "jamesmoss/toml": "*", - "symfony/expression-language": "~2.4", - "webmozart/puli": "~1.0@alpha" + "symfony/expression-language": "~2.4" }, "autoload": { "psr-4": { diff --git a/src/Loader/PuliLoader.php b/src/Loader/PuliLoader.php deleted file mode 100644 index b638bf8..0000000 --- a/src/Loader/PuliLoader.php +++ /dev/null @@ -1,58 +0,0 @@ - - */ -class PuliLoader implements LoaderInterface -{ - /** - * - * @var LoaderInterface - */ - protected $loader; - - /** - * - * @var ResourceLocatorInterface - */ - protected $locator; - - /** - * - * @param ResourceLocatorInterface $locator - * @param LoaderInterface $loader - */ - public function __construct(ResourceLocatorInterface $locator, LoaderInterface $loader) - { - $this->locator = $locator; - $this->loader = $loader; - } - - /** - * - * @param mixed $path - * @param array $options - * @return FixtureCollection - */ - public function load($path, array $options = array()) - { - if (isset($options['puli_tag']) && $options['puli_tag']) { - $realPaths = array(); - $resources = $this->locator->getByTag($path); - - foreach ($resources as $resource) { - $realPaths[] = $resource->getRealPath(); - } - } else { - $realPaths = $this->locator->get($path)->getRealPath(); - } - - return $this->loader->load($realPaths, $options); - } -} diff --git a/tests/Loader/PuliLoaderTest.php b/tests/Loader/PuliLoaderTest.php deleted file mode 100644 index be909d6..0000000 --- a/tests/Loader/PuliLoaderTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - */ -class PuliLoaderTest extends \PHPUnit_Framework_TestCase -{ - - private $repo; - private $mockLoader; - - /** - * - * @var FixtureLoader - */ - private $loader; - - public function setUp() - { - $this->repo = new ResourceRepository(); - $this->mockLoader = $this->getMock('DavidBadura\Fixtures\Loader\LoaderInterface'); - $this->loader = new PuliLoader($this->repo, $this->mockLoader); - } - - public function testLoadFixture() - { - $this->repo->add('/test/fixtures', __DIR__ . '/../TestResources/fixtures/'); - - $this->mockLoader->expects($this->any())->method('load') - ->with($this->equalTo(realpath(__DIR__ . '/../TestResources/fixtures/user.yml')))->will($this->returnValue(true)); - - $data = $this->loader->load('/test/fixtures/user.yml'); - - $this->assertEquals(true, $data); - } - - public function testLoadFixtureByTags() - { - $this->repo->add('/test/fixtures', __DIR__ . '/../TestResources/fixtures/'); - $this->repo->tag('/test/fixtures/*', 'test/fixtures'); - - $path = realpath(__DIR__ . '/../TestResources/fixtures') . '/*'; - $paths = glob($path); - - $this->mockLoader->expects($this->any())->method('load') - ->with($this->equalTo($paths))->will($this->returnValue(true)); - - $data = $this->loader->load('test/fixtures', array('puli_tag' => true)); - - $this->assertEquals(true, $data); - } -}