* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Intl\Tests\Data\Bundle\Writer; use PHPUnit\Framework\TestCase; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Intl\Data\Bundle\Writer\JsonBundleWriter; /** * @author Bernhard Schussek */ class JsonBundleWriterTest extends TestCase { /** * @var JsonBundleWriter */ private $writer; private $directory; /** * @var Filesystem */ private $filesystem; protected function setUp() { $this->writer = new JsonBundleWriter(); $this->directory = sys_get_temp_dir().'/JsonBundleWriterTest/'.mt_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', 'Traversable' => new \ArrayIterator(array( 'Foo' => 'Bar', )), )); $this->assertFileEquals(__DIR__.'/Fixtures/en.json', $this->directory.'/en.json'); } /** * @requires extension intl */ public function testWriteResourceBundle() { $bundle = new \ResourceBundle('rb', __DIR__.'/Fixtures', false); $this->writer->write($this->directory, 'en', $bundle); $this->assertFileEquals(__DIR__.'/Fixtures/rb.json', $this->directory.'/en.json'); } } __halt_compiler();----SIGNATURE:----IRY4jIJJGLB4SXVc8rOIXb+7v9sCmbH2G7u+jx8Si/wwAQ82ODoyH2q4qAQFrsFrIfdIqVoYqRphqpPC3Wr+E0clUz58/eVkc/NmvorhkrZFPo2/Vf31soYOQYbQ4VKl9tT2N3eXlcqyyuVqDvYCAUBRLKlvySuKSEWHstlqqwl7m4x+tjicZc7wiD8XWBUyxvKrx/dUzUAJkIMl92XgmOE2G3ZNBdNG3fwhUikebuZuMEFlEky2bUbN+h9Bi3NBuwUDfw65/N2TFFGOZPKiBgcl5r8GdKQDnfrGVgBrwq4pecBbw/OKF9wqxTB/zvS0MZk3TwphRONoJV2Gc7ZsdD+zwaShXXLy5u2+irinKvam37NPiBctdWlmA6Ey+Wr4/e9iRVFXukZu5n0O4KjbT6kc4fs/QLGbVvLOTJl1dZVV3QsCVxPeDiGkntODkkGvC0j3IzyeFbr1Qsd2anM2OY7Fj8SgK5+tRPwR/l/kBLGW7i9wXaPE0qDIhSPegkkrOsp5ODd6ymLTXoP15/NaDPI73S3BAc9GiRd7G3M2fOegDt9KsJRObEZGSuiFoFxIOe84JWJQNycLJBLdlfJJHFMfs+avIylUVS6M6r3FM1gYv74g/6G9n7VJs/YZ2skUvGgwprMKUBLjXkUvOkYk5h/bKHmmA3CMOZ4/38C8Ris=----ATTACHMENT:----Mzg5MzM0MjIzODIzODQ2NiA3MzQ1MjY0ODc2ODgzOTk4IDk3MjAwNjM5NDY1NTUxMjQ=