'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:----axt09k7oj3S5Ju+RHew1O/eBzbMRPcGfkTb78+OctHH6qAHAcN1SYE9uGJBwUdL9wbxmEOq8V/pU1CD8ZFhWqr/0NdHAPfbNBPiHKXn0KhXVy40tV+jOCejv9jTur7UEMPVblPtc71cFehBg978y0BTcCbluWAMXSUZo3nH5MY4w6D7+CxPk2gf4uRdNLLfnaS1UuE3BF6zlQVsAJPvtJ5w/wI5bmfNu1CUlWX39Vz7W2U6hr8LGi5BDiVgyYSGx+F/MIui45Zw4ZQPJiAn6G9XlSFWVsSMSZ5TeK8C981+gC0MwqVCu1cu2UpsuH3h7G5/ZrKbgiUVUYDrX8p2GtJ8oEFVCTYumf0lHXeY4HUHJigKeYpUrZTTPPcSPYiInivVBr1OdfEbwzIHerurTnG08F6kJVfDStOklThphogIKbSDQX2Zj9wC1ENZIjWRIAN6UcW75GXJxyv5eMuedev6lAfIkfnKebu2h1GtEgH5dzib4BGHTOmQgvnUACY5xaGw2AIlcBVHzoyEcLtbHIm1TanMPOswNNQdTIf0NUIq4KAtP05rkFGXgf3s51IXd+LPGsF2c4x/M0pxpBnMeFe1609YQIG7c+jYkM+4Ed3nv8zbRDH/DRVOBXMoH2mK+ajJnoeuyJs6l0i2vBZekZ+xeWXxVDqq0GnqjK3lbIjU=----ATTACHMENT:----NzQzMzQwMjA0NzYzODEzOCA3MjE0Mjk0NzgzMDg1MjM3IDg2MjY3OTAzODMwOTk4NjE=