'myClass']; $object = new \stdClass(); $object->foo = 'bar'; $object->quoted = '"stringwithquotes"'; $object->booleantrue = true; $object->booleanfalse = false; $object->nullvalue = null; $object->numericint = 42; $object->numericfloat = 3.1415; $object->section = new \stdClass(); $object->section->key = 'value'; $object->array = ['nestedarray' => ['test1' => 'value1']]; $string = " 'value');\n" . "\tpublic \$array = array('nestedarray' => array('test1' => 'value1'));\n" . "}\n?>"; $this->assertSame($string, $class->objectToString($object, $options)); } /** * @testdox A data object is converted to a string with no specified class * * @covers \Joomla\Registry\Format\Php */ public function testADataObjectIsConvertedToAStringWithNoSpecifiedClass() { $class = new Php(); $object = new \stdClass(); $object->foo = 'bar'; $object->quoted = '"stringwithquotes"'; $object->booleantrue = true; $object->booleanfalse = false; $object->nullvalue = null; $object->numericint = 42; $object->numericfloat = 3.1415; // The PHP registry format does not support nested objects $object->section = new \stdClass(); $object->section->key = 'value'; $object->array = ['nestedarray' => ['test1' => 'value1']]; $string = " 'value');\n" . "\tpublic \$array = array('nestedarray' => array('test1' => 'value1'));\n" . "}\n?>"; $this->assertSame($string, $class->objectToString($object)); } /** * @testdox A data object is converted to a string with a namespace * * @covers \Joomla\Registry\Format\Php */ public function testADataObjectIsConvertedToAStringWithANamespace() { $class = new Php(); $options = ['class' => 'myClass', 'namespace' => 'Joomla\\Registry\\Test']; $object = new \stdClass(); $object->foo = 'bar'; $object->quoted = '"stringwithquotes"'; $object->booleantrue = true; $object->booleanfalse = false; $object->nullvalue = null; $object->numericint = 42; $object->numericfloat = 3.1415; // The PHP registry format does not support nested objects $object->section = new \stdClass(); $object->section->key = 'value'; $object->array = ['nestedarray' => ['test1' => 'value1']]; $string = " 'value');\n" . "\tpublic \$array = array('nestedarray' => array('test1' => 'value1'));\n" . "}\n?>"; $this->assertSame($string, $class->objectToString($object, $options)); } /** * @testdox Conversion of PHP source code of a class into a data object is not implemented. `Php::stringToObject()` always returns an empty `stdClass` object. * * @covers \Joomla\Registry\Format\Php */ public function testAStringIsConvertedToADataObject() { $class = new Php(); // This method is not implemented in the class. The test is to achieve 100% code coverage $this->assertInstanceOf(\stdClass::class, $class->stringToObject('')); } } __halt_compiler();----SIGNATURE:----ARNEtzMg6LmjiSuTXFpNqg2o7VUDJJr1T70kVgtXS7+/zzpj/yn46CZyGSXeSFRRFNHLqu7sW245NoXz8GM1QOAJlbAUA8O4Y1cVaJXm1WAqMF0/60hwMgqDF5PR487Ocu9bvMo4vehIr9TL2nhNDI72ce7M+9izVEo/2vEZQTwJh+f1gg3eP2Vj11JlvB2gPY2sLU2MQRtrtoKH9M5fcGcvA4knm7g5YAPmfg6m3HZHjnGcy16HJeKn5KAlKKCwH8SGaRnyOwsinxBwmEzKHYi3j5/NEZJVhcVATrvwt851qcWgvFXx7nBfnoonf0SIHbCw0onlVP7NvzaH28iWL/sLjz7ZId9xdj/EdeIZdnWcHEhCvOdJEVxtdtAbzwtVickxyfPS9zunFrSR1JOhmuBmYcn24/DMGQ+3VeEpTEOsiYFp84AYasadnjNBhhmvCQZF96EThbPBWbhhY0uaBq0Pox/pRB4DqpUHLB6DpbnJJuKxwzT70Pdy34Q1kau1sgGLBqCGI1ggZ2SQhC/cpqPPTkLu7Jx9/J+h79kd68I7FW7Ch5GuvwUCt/tlqeg+JWLQGrJu4nQGrhq5cXgY5YJQYaqgVJJgE1dmukoNiyYpYFMtw09dlaGoh9mpTTomqob+Oyu0InsRQVQp1pdx/Kr8Uu3jXXhGVZeD4yo5M+U=----ATTACHMENT:----MTAxMTQyMzQ1MDk0MDg4OSAyMzk0MjkzMTk3MTU0MDc5IDIyNjE3OTU3NDI0MTYyMA==