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 --- .../Tests/ResourceBundle/AbstractBundleTest.php | 55 ----- .../Tests/ResourceBundle/CurrencyBundleTest.php | 98 --------- .../Tests/ResourceBundle/LanguageBundleTest.php | 197 ------------------ .../Intl/Tests/ResourceBundle/LocaleBundleTest.php | 64 ------ .../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 --------------------- .../Intl/Tests/ResourceBundle/RegionBundleTest.php | 63 ------ .../Tests/ResourceBundle/Util/RingBufferTest.php | 101 ---------- .../Tests/ResourceBundle/Writer/Fixtures/en.php | 23 --- .../Tests/ResourceBundle/Writer/Fixtures/en.res | Bin 316 -> 0 bytes .../Tests/ResourceBundle/Writer/Fixtures/en.txt | 23 --- .../ResourceBundle/Writer/PhpBundleWriterTest.php | 62 ------ .../ResourceBundle/Writer/TextBundleWriterTest.php | 67 ------- 19 files changed, 1178 deletions(-) delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/AbstractBundleTest.php delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/CurrencyBundleTest.php delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/LanguageBundleTest.php delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/LocaleBundleTest.php 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 delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/RegionBundleTest.php delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Util/RingBufferTest.php delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/Fixtures/en.php delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/Fixtures/en.res delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/Fixtures/en.txt delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/PhpBundleWriterTest.php delete mode 100644 vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/TextBundleWriterTest.php (limited to 'vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle') diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/AbstractBundleTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/AbstractBundleTest.php deleted file mode 100644 index 6b075865..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/AbstractBundleTest.php +++ /dev/null @@ -1,55 +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; - -/** - * @author Bernhard Schussek - */ -class AbstractBundleTest extends \PHPUnit_Framework_TestCase -{ - const RES_DIR = '/base/dirName'; - - /** - * @var \Symfony\Component\Intl\ResourceBundle\AbstractBundle - */ - private $bundle; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $reader; - - protected function setUp() - { - $this->reader = $this->getMock('Symfony\Component\Intl\ResourceBundle\Reader\StructuredBundleReaderInterface'); - $this->bundle = $this->getMockForAbstractClass( - 'Symfony\Component\Intl\ResourceBundle\AbstractBundle', - array(self::RES_DIR, $this->reader) - ); - - $this->bundle->expects($this->any()) - ->method('getDirectoryName') - ->will($this->returnValue('dirName')); - } - - public function testGetLocales() - { - $locales = array('de', 'en', 'fr'); - - $this->reader->expects($this->once()) - ->method('getLocales') - ->with(self::RES_DIR) - ->will($this->returnValue($locales)); - - $this->assertSame($locales, $this->bundle->getLocales()); - } -} diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/CurrencyBundleTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/CurrencyBundleTest.php deleted file mode 100644 index b66a6727..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/CurrencyBundleTest.php +++ /dev/null @@ -1,98 +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; - -use Symfony\Component\Intl\ResourceBundle\CurrencyBundle; - -/** - * @author Bernhard Schussek - */ -class CurrencyBundleTest extends \PHPUnit_Framework_TestCase -{ - const RES_DIR = '/base/curr'; - - /** - * @var CurrencyBundle - */ - private $bundle; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $reader; - - protected function setUp() - { - $this->reader = $this->getMock('Symfony\Component\Intl\ResourceBundle\Reader\StructuredBundleReaderInterface'); - $this->bundle = new CurrencyBundle(self::RES_DIR, $this->reader); - } - - public function testGetCurrencySymbol() - { - $this->reader->expects($this->once()) - ->method('readEntry') - ->with(self::RES_DIR, 'en', array('Currencies', 'EUR', 1)) - ->will($this->returnValue('€')); - - $this->assertSame('€', $this->bundle->getCurrencySymbol('EUR', 'en')); - } - - public function testGetCurrencyName() - { - $this->reader->expects($this->once()) - ->method('readEntry') - ->with(self::RES_DIR, 'en', array('Currencies', 'EUR', 0)) - ->will($this->returnValue('Euro')); - - $this->assertSame('Euro', $this->bundle->getCurrencyName('EUR', 'en')); - } - - public function testGetCurrencyNames() - { - $sortedCurrencies = array( - 'USD' => array(0 => 'Dollar'), - 'EUR' => array(0 => 'Euro'), - ); - - $this->reader->expects($this->once()) - ->method('readEntry') - ->with(self::RES_DIR, 'en', array('Currencies')) - ->will($this->returnValue($sortedCurrencies)); - - $sortedNames = array( - 'USD' => 'Dollar', - 'EUR' => 'Euro', - ); - - $this->assertSame($sortedNames, $this->bundle->getCurrencyNames('en')); - } - - public function testGetFractionDigits() - { - $this->reader->expects($this->once()) - ->method('readEntry') - ->with(self::RES_DIR, 'en', array('Currencies', 'EUR', 2)) - ->will($this->returnValue(123)); - - $this->assertSame(123, $this->bundle->getFractionDigits('EUR')); - } - - public function testGetRoundingIncrement() - { - $this->reader->expects($this->once()) - ->method('readEntry') - ->with(self::RES_DIR, 'en', array('Currencies', 'EUR', 3)) - ->will($this->returnValue(123)); - - $this->assertSame(123, $this->bundle->getRoundingIncrement('EUR')); - } -} diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/LanguageBundleTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/LanguageBundleTest.php deleted file mode 100644 index 96031fc7..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/LanguageBundleTest.php +++ /dev/null @@ -1,197 +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; - -use Symfony\Component\Intl\ResourceBundle\LanguageBundle; - -/** - * @author Bernhard Schussek - */ -class LanguageBundleTest extends \PHPUnit_Framework_TestCase -{ - const RES_DIR = '/base/lang'; - - /** - * @var LanguageBundle - */ - private $bundle; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $reader; - - protected function setUp() - { - $this->reader = $this->getMock('Symfony\Component\Intl\ResourceBundle\Reader\StructuredBundleReaderInterface'); - $this->bundle = new LanguageBundle(self::RES_DIR, $this->reader); - } - - public function testGetLanguageName() - { - $languages = array( - 'de' => 'German', - 'en' => 'English', - ); - - $this->reader->expects($this->once()) - ->method('readEntry') - ->with(self::RES_DIR, 'en', array('Languages')) - ->will($this->returnValue($languages)); - - $this->assertSame('German', $this->bundle->getLanguageName('de', null, 'en')); - } - - public function testGetLanguageNameWithRegion() - { - $languages = array( - 'de' => 'German', - 'en' => 'English', - 'en_GB' => 'British English', - ); - - $this->reader->expects($this->once()) - ->method('readEntry') - ->with(self::RES_DIR, 'en', array('Languages')) - ->will($this->returnValue($languages)); - - $this->assertSame('British English', $this->bundle->getLanguageName('en', 'GB', 'en')); - } - - public function testGetLanguageNameWithUntranslatedRegion() - { - $languages = array( - 'de' => 'German', - 'en' => 'English', - ); - - $this->reader->expects($this->once()) - ->method('readEntry') - ->with(self::RES_DIR, 'en', array('Languages')) - ->will($this->returnValue($languages)); - - $this->assertSame('English', $this->bundle->getLanguageName('en', 'US', 'en')); - } - - public function testGetLanguageNames() - { - $sortedLanguages = array( - 'en' => 'English', - 'de' => 'German', - ); - - $this->reader->expects($this->once()) - ->method('readEntry') - ->with(self::RES_DIR, 'en', array('Languages')) - ->will($this->returnValue($sortedLanguages)); - - $this->assertSame($sortedLanguages, $this->bundle->getLanguageNames('en')); - } - - public function testGetScriptName() - { - $data = array( - 'Languages' => array( - 'de' => 'German', - 'en' => 'English', - ), - 'Scripts' => array( - 'Latn' => 'latin', - 'Cyrl' => 'cyrillique', - ), - ); - - $this->reader->expects($this->once()) - ->method('read') - ->with(self::RES_DIR, 'en') - ->will($this->returnValue($data)); - - $this->assertSame('latin', $this->bundle->getScriptName('Latn', null, 'en')); - } - - public function testGetScriptNameIncludedInLanguage() - { - $data = array( - 'Languages' => array( - 'de' => 'German', - 'en' => 'English', - 'zh_Hans' => 'Simplified Chinese', - ), - 'Scripts' => array( - 'Latn' => 'latin', - 'Cyrl' => 'cyrillique', - ), - ); - - $this->reader->expects($this->once()) - ->method('read') - ->with(self::RES_DIR, 'en') - ->will($this->returnValue($data)); - - // Null because the script is included in the language anyway - $this->assertNull($this->bundle->getScriptName('Hans', 'zh', 'en')); - } - - public function testGetScriptNameIncludedInLanguageInBraces() - { - $data = array( - 'Languages' => array( - 'de' => 'German', - 'en' => 'English', - 'zh_Hans' => 'Chinese (simplified)', - ), - 'Scripts' => array( - 'Latn' => 'latin', - 'Cyrl' => 'cyrillique', - ), - ); - - $this->reader->expects($this->once()) - ->method('read') - ->with(self::RES_DIR, 'en') - ->will($this->returnValue($data)); - - $this->assertSame('simplified', $this->bundle->getScriptName('Hans', 'zh', 'en')); - } - - public function testGetScriptNameNoScriptsBlock() - { - $data = array( - 'Languages' => array( - 'de' => 'German', - 'en' => 'English', - ), - ); - - $this->reader->expects($this->once()) - ->method('read') - ->with(self::RES_DIR, 'en') - ->will($this->returnValue($data)); - - $this->assertNull($this->bundle->getScriptName('Latn', null, 'en')); - } - - public function testGetScriptNames() - { - $sortedScripts = array( - 'Cyrl' => 'cyrillique', - 'Latn' => 'latin', - ); - - $this->reader->expects($this->once()) - ->method('readEntry') - ->with(self::RES_DIR, 'en', array('Scripts')) - ->will($this->returnValue($sortedScripts)); - - $this->assertSame($sortedScripts, $this->bundle->getScriptNames('en')); - } -} diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/LocaleBundleTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/LocaleBundleTest.php deleted file mode 100644 index ddfdc3d2..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/LocaleBundleTest.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; - -use Symfony\Component\Intl\ResourceBundle\LocaleBundle; - -/** - * @author Bernhard Schussek - */ -class LocaleBundleTest extends \PHPUnit_Framework_TestCase -{ - const RES_DIR = '/base/locales'; - - /** - * @var LocaleBundle - */ - private $bundle; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $reader; - - protected function setUp() - { - $this->reader = $this->getMock('Symfony\Component\Intl\ResourceBundle\Reader\StructuredBundleReaderInterface'); - $this->bundle = new LocaleBundle(self::RES_DIR, $this->reader); - } - - public function testGetLocaleName() - { - $this->reader->expects($this->once()) - ->method('readEntry') - ->with(self::RES_DIR, 'en', array('Locales', 'de_AT')) - ->will($this->returnValue('German (Austria)')); - - $this->assertSame('German (Austria)', $this->bundle->getLocaleName('de_AT', 'en')); - } - - public function testGetLocaleNames() - { - $sortedLocales = array( - 'en_IE' => 'English (Ireland)', - 'en_GB' => 'English (United Kingdom)', - 'en_US' => 'English (United States)', - ); - - $this->reader->expects($this->once()) - ->method('readEntry') - ->with(self::RES_DIR, 'en', array('Locales')) - ->will($this->returnValue($sortedLocales)); - - $this->assertSame($sortedLocales, $this->bundle->getLocaleNames('en')); - } -} 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)); - } -} diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/RegionBundleTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/RegionBundleTest.php deleted file mode 100644 index ccdf904c..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/RegionBundleTest.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; - -use Symfony\Component\Intl\ResourceBundle\RegionBundle; - -/** - * @author Bernhard Schussek - */ -class RegionBundleTest extends \PHPUnit_Framework_TestCase -{ - const RES_DIR = '/base/region'; - - /** - * @var RegionBundle - */ - private $bundle; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $reader; - - protected function setUp() - { - $this->reader = $this->getMock('Symfony\Component\Intl\ResourceBundle\Reader\StructuredBundleReaderInterface'); - $this->bundle = new RegionBundle(self::RES_DIR, $this->reader); - } - - public function testGetCountryName() - { - $this->reader->expects($this->once()) - ->method('readEntry') - ->with(self::RES_DIR, 'en', array('Countries', 'AT')) - ->will($this->returnValue('Austria')); - - $this->assertSame('Austria', $this->bundle->getCountryName('AT', 'en')); - } - - public function testGetCountryNames() - { - $sortedCountries = array( - 'AT' => 'Austria', - 'DE' => 'Germany', - ); - - $this->reader->expects($this->once()) - ->method('readEntry') - ->with(self::RES_DIR, 'en', array('Countries')) - ->will($this->returnValue($sortedCountries)); - - $this->assertSame($sortedCountries, $this->bundle->getCountryNames('en')); - } -} diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Util/RingBufferTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Util/RingBufferTest.php deleted file mode 100644 index d6f7d8a0..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Util/RingBufferTest.php +++ /dev/null @@ -1,101 +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\Util; - -use Symfony\Component\Intl\ResourceBundle\Util\RingBuffer; - -/** - * @author Bernhard Schussek - */ -class RingBufferTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var RingBuffer - */ - private $buffer; - - protected function setUp() - { - $this->buffer = new RingBuffer(2); - } - - public function testWriteWithinBuffer() - { - $this->buffer[0] = 'foo'; - $this->buffer['bar'] = 'baz'; - - $this->assertTrue(isset($this->buffer[0])); - $this->assertTrue(isset($this->buffer['bar'])); - $this->assertSame('foo', $this->buffer[0]); - $this->assertSame('baz', $this->buffer['bar']); - } - - public function testWritePastBuffer() - { - $this->buffer[0] = 'foo'; - $this->buffer['bar'] = 'baz'; - $this->buffer[2] = 'bam'; - - $this->assertTrue(isset($this->buffer['bar'])); - $this->assertTrue(isset($this->buffer[2])); - $this->assertSame('baz', $this->buffer['bar']); - $this->assertSame('bam', $this->buffer[2]); - } - - /** - * @expectedException \Symfony\Component\Intl\Exception\OutOfBoundsException - */ - public function testReadNonExistingFails() - { - $this->buffer['foo']; - } - - public function testQueryNonExisting() - { - $this->assertFalse(isset($this->buffer['foo'])); - } - - public function testUnsetNonExistingSucceeds() - { - unset($this->buffer['foo']); - - $this->assertFalse(isset($this->buffer['foo'])); - } - - /** - * @expectedException \Symfony\Component\Intl\Exception\OutOfBoundsException - */ - public function testReadOverwrittenFails() - { - $this->buffer[0] = 'foo'; - $this->buffer['bar'] = 'baz'; - $this->buffer[2] = 'bam'; - - $this->buffer[0]; - } - - public function testQueryOverwritten() - { - $this->assertFalse(isset($this->buffer[0])); - } - - public function testUnsetOverwrittenSucceeds() - { - $this->buffer[0] = 'foo'; - $this->buffer['bar'] = 'baz'; - $this->buffer[2] = 'bam'; - - unset($this->buffer[0]); - - $this->assertFalse(isset($this->buffer[0])); - } -} diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/Fixtures/en.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/Fixtures/en.php deleted file mode 100644 index 1ded57a7..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/Fixtures/en.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'Entry1' => array( - 'Array' => array( - 0 => 'foo', - 1 => 'bar', - ), - 'Integer' => 5, - 'Boolean' => false, - 'Float' => 1.23, - ), - 'Entry2' => 'String', -); diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/Fixtures/en.res b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/Fixtures/en.res deleted file mode 100644 index 7c1f71eb..00000000 Binary files a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/Fixtures/en.res and /dev/null differ diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/Fixtures/en.txt b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/Fixtures/en.txt deleted file mode 100644 index 0ee0d7f2..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/Fixtures/en.txt +++ /dev/null @@ -1,23 +0,0 @@ -en{ - Entry1{ - Array{ - "foo", - "bar", - { - Key{"value"} - }, - } - Integer:int{5} - IntVector:intvector{ - 0, - 1, - 2, - 3, - } - FalseBoolean{"false"} - TrueBoolean{"true"} - Null{""} - Float{"1.23"} - } - Entry2{"String"} -} diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/PhpBundleWriterTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/PhpBundleWriterTest.php deleted file mode 100644 index 03302834..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/PhpBundleWriterTest.php +++ /dev/null @@ -1,62 +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\Writer; - -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\Intl\ResourceBundle\Writer\PhpBundleWriter; - -/** - * @author Bernhard Schussek - */ -class PhpBundleWriterTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var PhpBundleWriter - */ - private $writer; - - private $directory; - - /** - * @var Filesystem - */ - private $filesystem; - - protected function setUp() - { - $this->writer = new PhpBundleWriter(); - $this->directory = sys_get_temp_dir() . '/PhpBundleWriterTest/' . rand(1000, 9999); - $this->filesystem = new Filesystem(); - - $this->filesystem->mkdir($this->directory); - } - - protected function tearDown() - { - $this->filesystem->remove($this->directory); - } - - public function testWrite() - { - $this->writer->write($this->directory, 'en', array( - 'Entry1' => array( - 'Array' => array('foo', 'bar'), - 'Integer' => 5, - 'Boolean' => false, - 'Float' => 1.23, - ), - 'Entry2' => 'String', - )); - - $this->assertFileEquals(__DIR__ . '/Fixtures/en.php', $this->directory . '/en.php'); - } -} diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/TextBundleWriterTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/TextBundleWriterTest.php deleted file mode 100644 index cbe0c8d8..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Writer/TextBundleWriterTest.php +++ /dev/null @@ -1,67 +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\Writer; - -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\Intl\ResourceBundle\Writer\TextBundleWriter; - -/** - * @author Bernhard Schussek - * - * @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt - */ -class TextBundleWriterTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var TextBundleWriter - */ - private $writer; - - private $directory; - - /** - * @var Filesystem - */ - private $filesystem; - - protected function setUp() - { - $this->writer = new TextBundleWriter(); - $this->directory = sys_get_temp_dir() . '/TextBundleWriterTest/' . rand(1000, 9999); - $this->filesystem = new Filesystem(); - - $this->filesystem->mkdir($this->directory); - } - - protected function tearDown() - { - $this->filesystem->remove($this->directory); - } - - public function testWrite() - { - $this->writer->write($this->directory, 'en', array( - 'Entry1' => array( - 'Array' => array('foo', 'bar', array('Key' => 'value')), - 'Integer' => 5, - 'IntVector' => array(0, 1, 2, 3), - 'FalseBoolean' => false, - 'TrueBoolean' => true, - 'Null' => null, - 'Float' => 1.23, - ), - 'Entry2' => 'String', - )); - - $this->assertFileEquals(__DIR__ . '/Fixtures/en.txt', $this->directory . '/en.txt'); - } -} -- cgit v1.2.3