api/symfony/Component/Intl/Tests/Data/Bundle/Writer/JsonBundleWriterTest.yaml
2024-09-26 02:03:21 -07:00

33 lines
1.7 KiB
YAML

name: JsonBundleWriterTest
class_comment: '# * @author Bernhard Schussek <bschussek@gmail.com>'
dependencies:
- name: TestCase
type: class
source: PHPUnit\Framework\TestCase
- name: Filesystem
type: class
source: Symfony\Component\Filesystem\Filesystem
- name: JsonBundleWriter
type: class
source: Symfony\Component\Intl\Data\Bundle\Writer\JsonBundleWriter
properties: []
methods:
- name: testWriteResourceBundle
visibility: public
parameters: []
comment: "# * @author Bernhard Schussek <bschussek@gmail.com>\n# */\n# class JsonBundleWriterTest\
\ extends TestCase\n# {\n# private JsonBundleWriter $writer;\n# private string\
\ $directory;\n# private Filesystem $filesystem;\n# \n# protected function setUp():\
\ void\n# {\n# $this->writer = new JsonBundleWriter();\n# $this->directory = sys_get_temp_dir().'/JsonBundleWriterTest/'.mt_rand(1000,\
\ 9999);\n# $this->filesystem = new Filesystem();\n# \n# $this->filesystem->mkdir($this->directory);\n\
# }\n# \n# protected function tearDown(): void\n# {\n# $this->filesystem->remove($this->directory);\n\
# }\n# \n# public function testWrite()\n# {\n# $this->writer->write($this->directory,\
\ 'en', [\n# 'Entry1' => [\n# 'Array' => ['foo', 'bar'],\n# 'Integer' => 5,\n\
# 'Boolean' => false,\n# 'Float' => 1.23,\n# ],\n# 'Entry2' => 'String',\n# 'Traversable'\
\ => new \\ArrayIterator([\n# 'Foo' => 'Bar',\n# ]),\n# ]);\n# \n# $this->assertFileEquals(__DIR__.'/Fixtures/en.json',\
\ $this->directory.'/en.json');\n# }\n# \n# /**\n# * @requires extension intl"
traits:
- PHPUnit\Framework\TestCase
- Symfony\Component\Filesystem\Filesystem
- Symfony\Component\Intl\Data\Bundle\Writer\JsonBundleWriter
interfaces: []