public function testRoot() { $root = new SimpleDOM('<root />'); $new = new SimpleDOM('<new />'); $expected_result = clone $new; $expected_return = clone $root; $return = $root->replaceSelf($new); $this->assertEquals($expected_result, $root); $this->assertEquals($expected_return, $return); }