/** * @test */ public function shouldNotReplaceWhenTableNameIsPartOfOtherTableName() { //given $onClauses = array(WhereClause::create('products.active = true'), WhereClause::create('order_products.active = true')); $joinClause = new JoinClause('products', 'id', 'product_id', 'order_products', 'p', 'LEFT', $onClauses); //when $buildJoinQueryPart = DialectUtil::buildJoinQueryPart($joinClause); //then Assert::thatString($buildJoinQueryPart)->isEqualTo('LEFT JOIN products AS p ON p.id = order_products.product_id AND p.active = true AND order_products.active = true'); }