/** * Test copyInto method. */ public function testCopyInto_Deep() { // Test a "normal" object $c = new Criteria(); $c->add(BookPeer::TITLE, 'Harry%', Criteria::LIKE); $book = BookPeer::doSelectOne($c); $reviews = $book->getReviews(); $b2 = $book->copy(true); $this->assertType('Book', $b2); $this->assertNull($b2->getId()); $r2 = $b2->getReviews(); $this->assertEquals(count($reviews), count($r2)); // Test a one-to-one object $emp = BookstoreEmployeePeer::doSelectOne(new Criteria()); $e2 = $emp->copy(true); $this->assertType('BookstoreEmployee', $e2); $this->assertNull($e2->getId()); $this->assertEquals($emp->getBookstoreEmployeeAccount()->getLogin(), $e2->getBookstoreEmployeeAccount()->getLogin()); }