. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ namespace tests\Espo\Core\Utils; use Espo\Core\Utils\ObjectUtil; class ObjectUtilTest extends \PHPUnit\Framework\TestCase { public function testClone1() { $original = (object) [ 'key1' => '1', 'key2' => (object) [ 'key21' => [ '211', '212', (object) [ '2111' => '1', ], ], ], 'key3' => [ '31', '32', null, ], 'key4' => null, ]; $cloned = ObjectUtil::clone($original); $this->assertEquals($cloned, $original); $this->assertNotSame($cloned, $original); $this->assertNotSame($cloned->key2, $original->key2); $this->assertNotSame($cloned->key2->key21[2], $original->key2->key21[2]); } }