diff --git a/tests/JoinSqlTest.php b/tests/JoinSqlTest.php index a04d5201a..90f46e783 100644 --- a/tests/JoinSqlTest.php +++ b/tests/JoinSqlTest.php @@ -599,38 +599,4 @@ public function testJoinHasOneHasMany() ['id' => 41, 'contact_id' => 10, 'address' => 'johnny@foo.net'], ], $m_u->ref('Email')->export()); } - - public function testJoinOneOnOne() - { - $this->setDb([ - 'user' => [ - 10 => ['id' => 10, 'name' => 'John'], - 20 => ['id' => 20, 'name' => 'Peter'], - ], 'detail' => [ - 100 => ['id' => 100, 'user_id' => 10, 'notes' => 'first note'], - 200 => ['id' => 200, 'user_id' => 20, 'notes' => 'second note'], - ], - ]); - - $db = new Persistence\Sql($this->db->connection); - $m_user = new Model($db, 'user'); - $m_user->addField('name'); - $j = $m_user->join('detail', [ - 'master_field' => 'id', - 'foreign_field' => 'user_id', - ]); - $j->addField('notes'); - - // try load one record - $m = (clone $m_user)->tryLoad(20); - $this->assertTrue($m->loaded()); - $this->assertEquals(['id' => 20, 'name' => 'Peter', 'notes' => 'second note'], $m->get()); - - // insert new record - $m = (clone $m_user)->save(['name' => 'Emily']); -var_export($this->getDb()); - - - - } }