From 46b77928f746a4231d064774b5b67fd892c7ce86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sun, 4 Aug 2013 17:50:34 +0200 Subject: rm vendor --- .../Reader/AbstractBundleReaderTest.php | 64 ------ .../Reader/BinaryBundleReaderTest.php | 58 ------ .../Reader/Fixtures/NotAFile/en.php/.gitkeep | 0 .../Tests/ResourceBundle/Reader/Fixtures/en.php | 14 -- .../Tests/ResourceBundle/Reader/Fixtures/en.res | Bin 84 -> 0 bytes .../Tests/ResourceBundle/Reader/Fixtures/en.txt | 3 - .../ResourceBundle/Reader/PhpBundleReaderTest.php | 63 ------ .../Reader/StructuredBundleReaderTest.php | 223 --------------------- 8 files changed, 425 deletions(-) delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/AbstractBundleReaderTest.php delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/BinaryBundleReaderTest.php delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/Fixtures/NotAFile/en.php/.gitkeep delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/Fixtures/en.php delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/Fixtures/en.res delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/Fixtures/en.txt delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/PhpBundleReaderTest.php delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/StructuredBundleReaderTest.php (limited to 'vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader') diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/AbstractBundleReaderTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/AbstractBundleReaderTest.php deleted file mode 100644 index 2da7f90d..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/AbstractBundleReaderTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Intl\Tests\ResourceBundle\Reader; - -use Symfony\Component\Filesystem\Filesystem; - -/** - * @author Bernhard Schussek - */ -class AbstractBundleReaderTest extends \PHPUnit_Framework_TestCase -{ - private $directory; - - /** - * @var Filesystem - */ - private $filesystem; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $reader; - - protected function setUp() - { - $this->directory = sys_get_temp_dir() . '/AbstractBundleReaderTest/' . rand(1000, 9999); - $this->filesystem = new Filesystem(); - $this->reader = $this->getMockForAbstractClass('Symfony\Component\Intl\ResourceBundle\Reader\AbstractBundleReader'); - - $this->filesystem->mkdir($this->directory); - } - - protected function tearDown() - { - $this->filesystem->remove($this->directory); - } - - public function testGetLocales() - { - $this->filesystem->touch($this->directory . '/en.foo'); - $this->filesystem->touch($this->directory . '/de.foo'); - $this->filesystem->touch($this->directory . '/fr.foo'); - $this->filesystem->touch($this->directory . '/bo.txt'); - $this->filesystem->touch($this->directory . '/gu.bin'); - $this->filesystem->touch($this->directory . '/s.lol'); - - $this->reader->expects($this->any()) - ->method('getFileExtension') - ->will($this->returnValue('foo')); - - $sortedLocales = array('de', 'en', 'fr'); - - $this->assertSame($sortedLocales, $this->reader->getLocales($this->directory)); - } -} diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/BinaryBundleReaderTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/BinaryBundleReaderTest.php deleted file mode 100644 index 3aefbae7..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/BinaryBundleReaderTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Intl\Tests\ResourceBundle\Reader; - -use Symfony\Component\Intl\ResourceBundle\Reader\BinaryBundleReader; -use Symfony\Component\Intl\Util\IntlTestHelper; - -/** - * @author Bernhard Schussek - */ -class BinaryBundleReaderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var BinaryBundleReader - */ - private $reader; - - protected function setUp() - { - IntlTestHelper::requireFullIntl($this); - - $this->reader = new BinaryBundleReader(); - } - - public function testReadReturnsArrayAccess() - { - $data = $this->reader->read(__DIR__ . '/Fixtures', 'en'); - - $this->assertInstanceOf('\ArrayAccess', $data); - $this->assertSame('Bar', $data['Foo']); - $this->assertFalse(isset($data['ExistsNot'])); - } - - /** - * @expectedException \Symfony\Component\Intl\Exception\RuntimeException - */ - public function testReadFailsIfNonExistingLocale() - { - $this->reader->read(__DIR__ . '/Fixtures', 'foo'); - } - - /** - * @expectedException \Symfony\Component\Intl\Exception\RuntimeException - */ - public function testReadFailsIfNonExistingDirectory() - { - $this->reader->read(__DIR__ . '/foo', 'en'); - } -} diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/Fixtures/NotAFile/en.php/.gitkeep b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/Fixtures/NotAFile/en.php/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/Fixtures/en.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/Fixtures/en.php deleted file mode 100644 index f2b06a91..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/Fixtures/en.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'Foo' => 'Bar', -); diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/Fixtures/en.res b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/Fixtures/en.res deleted file mode 100644 index c78e9045..00000000 Binary files a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/Fixtures/en.res and /dev/null differ diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/Fixtures/en.txt b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/Fixtures/en.txt deleted file mode 100644 index c788e996..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/Fixtures/en.txt +++ /dev/null @@ -1,3 +0,0 @@ -en{ - Foo{"Bar"} -} diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/PhpBundleReaderTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/PhpBundleReaderTest.php deleted file mode 100644 index 2fee3559..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/PhpBundleReaderTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Intl\Tests\ResourceBundle\Reader; - -use Symfony\Component\Intl\ResourceBundle\Reader\PhpBundleReader; - -/** - * @author Bernhard Schussek - */ -class PhpBundleReaderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var PhpBundleReader - */ - private $reader; - - protected function setUp() - { - $this->reader = new PhpBundleReader(); - } - - public function testReadReturnsArray() - { - $data = $this->reader->read(__DIR__ . '/Fixtures', 'en'); - - $this->assertTrue(is_array($data)); - $this->assertSame('Bar', $data['Foo']); - $this->assertFalse(isset($data['ExistsNot'])); - } - - /** - * @expectedException \Symfony\Component\Intl\Exception\InvalidArgumentException - */ - public function testReadFailsIfLocaleOtherThanEn() - { - $this->reader->read(__DIR__ . '/Fixtures', 'foo'); - } - - /** - * @expectedException \Symfony\Component\Intl\Exception\RuntimeException - */ - public function testReadFailsIfNonExistingDirectory() - { - $this->reader->read(__DIR__ . '/foo', 'en'); - } - - /** - * @expectedException \Symfony\Component\Intl\Exception\RuntimeException - */ - public function testReadFailsIfNotAFile() - { - $this->reader->read(__DIR__ . '/Fixtures/NotAFile', 'en'); - } -} diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/StructuredBundleReaderTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/StructuredBundleReaderTest.php deleted file mode 100644 index 600236eb..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/StructuredBundleReaderTest.php +++ /dev/null @@ -1,223 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Intl\Tests\ResourceBundle\Reader; - -use Symfony\Component\Intl\ResourceBundle\Reader\StructuredBundleReader; - -/** - * @author Bernhard Schussek - */ -class StructuredBundleReaderTest extends \PHPUnit_Framework_TestCase -{ - const RES_DIR = '/res/dir'; - - /** - * @var StructuredBundleReader - */ - private $reader; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $readerImpl; - - protected function setUp() - { - $this->readerImpl = $this->getMock('Symfony\Component\Intl\ResourceBundle\Reader\StructuredBundleReaderInterface'); - $this->reader = new StructuredBundleReader($this->readerImpl); - } - - public function testGetLocales() - { - $locales = array('en', 'de', 'fr'); - - $this->readerImpl->expects($this->once()) - ->method('getLocales') - ->with(self::RES_DIR) - ->will($this->returnValue($locales)); - - $this->assertSame($locales, $this->reader->getLocales(self::RES_DIR)); - } - - public function testRead() - { - $data = array('foo', 'bar'); - - $this->readerImpl->expects($this->once()) - ->method('read') - ->with(self::RES_DIR, 'en') - ->will($this->returnValue($data)); - - $this->assertSame($data, $this->reader->read(self::RES_DIR, 'en')); - } - - public function testReadEntryNoParams() - { - $data = array('foo', 'bar'); - - $this->readerImpl->expects($this->once()) - ->method('read') - ->with(self::RES_DIR, 'en') - ->will($this->returnValue($data)); - - $this->assertSame($data, $this->reader->readEntry(self::RES_DIR, 'en', array())); - } - - public function testReadEntryWithParam() - { - $data = array('Foo' => array('Bar' => 'Baz')); - - $this->readerImpl->expects($this->once()) - ->method('read') - ->with(self::RES_DIR, 'en') - ->will($this->returnValue($data)); - - $this->assertSame('Baz', $this->reader->readEntry(self::RES_DIR, 'en', array('Foo', 'Bar'))); - } - - public function testReadEntryWithUnresolvablePath() - { - $data = array('Foo' => 'Baz'); - - $this->readerImpl->expects($this->once()) - ->method('read') - ->with(self::RES_DIR, 'en') - ->will($this->returnValue($data)); - - $this->assertNull($this->reader->readEntry(self::RES_DIR, 'en', array('Foo', 'Bar'))); - } - - public function readMergedEntryProvider() - { - return array( - array('foo', null, 'foo'), - array(null, 'foo', 'foo'), - array(array('foo', 'bar'), null, array('foo', 'bar')), - array(array('foo', 'bar'), array(), array('foo', 'bar')), - array(null, array('baz'), array('baz')), - array(array(), array('baz'), array('baz')), - array(array('foo', 'bar'), array('baz'), array('baz', 'foo', 'bar')), - ); - } - - /** - * @dataProvider readMergedEntryProvider - */ - public function testReadMergedEntryNoParams($childData, $parentData, $result) - { - $this->readerImpl->expects($this->at(0)) - ->method('read') - ->with(self::RES_DIR, 'en_GB') - ->will($this->returnValue($childData)); - - if (null === $childData || is_array($childData)) { - $this->readerImpl->expects($this->at(1)) - ->method('read') - ->with(self::RES_DIR, 'en') - ->will($this->returnValue($parentData)); - } - - $this->assertSame($result, $this->reader->readEntry(self::RES_DIR, 'en_GB', array(), true)); - } - - /** - * @dataProvider readMergedEntryProvider - */ - public function testReadMergedEntryWithParams($childData, $parentData, $result) - { - $this->readerImpl->expects($this->at(0)) - ->method('read') - ->with(self::RES_DIR, 'en_GB') - ->will($this->returnValue(array('Foo' => array('Bar' => $childData)))); - - if (null === $childData || is_array($childData)) { - $this->readerImpl->expects($this->at(1)) - ->method('read') - ->with(self::RES_DIR, 'en') - ->will($this->returnValue(array('Foo' => array('Bar' => $parentData)))); - } - - $this->assertSame($result, $this->reader->readEntry(self::RES_DIR, 'en_GB', array('Foo', 'Bar'), true)); - } - - public function testReadMergedEntryWithUnresolvablePath() - { - $this->readerImpl->expects($this->at(0)) - ->method('read') - ->with(self::RES_DIR, 'en_GB') - ->will($this->returnValue(array('Foo' => 'Baz'))); - - $this->readerImpl->expects($this->at(1)) - ->method('read') - ->with(self::RES_DIR, 'en') - ->will($this->returnValue(array('Foo' => 'Bar'))); - - $this->assertNull($this->reader->readEntry(self::RES_DIR, 'en_GB', array('Foo', 'Bar'), true)); - } - - public function testReadMergedEntryWithUnresolvablePathInParent() - { - $this->readerImpl->expects($this->at(0)) - ->method('read') - ->with(self::RES_DIR, 'en_GB') - ->will($this->returnValue(array('Foo' => array('Bar' => array('three'))))); - - $this->readerImpl->expects($this->at(1)) - ->method('read') - ->with(self::RES_DIR, 'en') - ->will($this->returnValue(array('Foo' => 'Bar'))); - - $result = array('three'); - - $this->assertSame($result, $this->reader->readEntry(self::RES_DIR, 'en_GB', array('Foo', 'Bar'), true)); - } - - public function testReadMergedEntryWithUnresolvablePathInChild() - { - $this->readerImpl->expects($this->at(0)) - ->method('read') - ->with(self::RES_DIR, 'en_GB') - ->will($this->returnValue(array('Foo' => 'Baz'))); - - $this->readerImpl->expects($this->at(1)) - ->method('read') - ->with(self::RES_DIR, 'en') - ->will($this->returnValue(array('Foo' => array('Bar' => array('one', 'two'))))); - - $result = array('one', 'two'); - - $this->assertSame($result, $this->reader->readEntry(self::RES_DIR, 'en_GB', array('Foo', 'Bar'), true)); - } - - /** - * @dataProvider readMergedEntryProvider - */ - public function testReadMergedEntryWithTraversables($childData, $parentData, $result) - { - $parentData = is_array($parentData) ? new \ArrayObject($parentData) : $parentData; - $childData = is_array($childData) ? new \ArrayObject($childData) : $childData; - - $this->readerImpl->expects($this->at(0)) - ->method('read') - ->with(self::RES_DIR, 'en_GB') - ->will($this->returnValue(array('Foo' => array('Bar' => $childData)))); - - if (null === $childData || $childData instanceof \ArrayObject) { - $this->readerImpl->expects($this->at(1)) - ->method('read') - ->with(self::RES_DIR, 'en') - ->will($this->returnValue(array('Foo' => array('Bar' => $parentData)))); - } - - $this->assertSame($result, $this->reader->readEntry(self::RES_DIR, 'en_GB', array('Foo', 'Bar'), true)); - } -} -- cgit v1.2.3