Example #1
0
 public function testSingularizeWords()
 {
     $input = file_get_contents(dirname(__FILE__) . '/xml/encode_singularize.xml');
     $xml = Decode::xml($input, array('singularize_words' => true, 'include_words' => array('obrazok' => 'obrazok'), 'exclude_words' => array('images')));
     $this->assertInternalType('array', $xml->toArray());
     $this->assertInternalType('object', $xml->toObject());
     $this->assertInstanceOf('\\Serializers\\Encoders\\Json', $xml->toJSON());
     $compared = $this->arraysAreEqual(array('shop' => 'supercars.com', 'cars' => array(array('manufacturer' => 'VW', 'model' => 'Golf', 'engine' => '1.9'), array('manufacturer' => 'Škoda', 'model' => 'Rapid', 'engine' => '1.6')), 'images' => array('image' => array(array('name' => 'foo', 'extension' => 'jpg'), array('name' => 'bar', 'extension' => 'jpg'))), 'obrazky' => array(array('name' => 'foo', 'extension' => 'jpg'))), $xml->toArray());
     $this->assertEquals($compared, true);
 }