/** * @test */ public function shouldJoinInlineRelation() { //given $product = Product::create(array('name' => 'sony')); $orderProduct = OrderProduct::create(array('id_product' => $product->getId())); //when $fetched = Product::join(Relation::inline(array('destinationField' => 'orderProduct', 'class' => 'Test\\OrderProduct', 'foreignKey' => 'id_product', 'localKey' => 'id')))->fetch(); //then $this->assertEquals($orderProduct, self::getNoLazy($fetched, 'orderProduct')); }