withAlias('testAlias') ->withConditions($conditions); $this->assertEquals('test', $join->getTarget()); $this->assertEquals('testAlias', $join->getAlias()); $this->assertEquals($conditions, $join->getConditions()); $this->assertTrue($join->isRelation()); $this->assertFalse($join->isTable()); $this->assertEquals(Join::TYPE_RELATION, $join->getType()); } public function testCreate2(): void { $conditions = Expr::isNull( Expr::column('test') ); $join = Join::createWithTableTarget('Test') ->withAlias('testAlias') ->withConditions($conditions); $this->assertEquals('Test', $join->getTarget()); $this->assertEquals('testAlias', $join->getAlias()); $this->assertEquals($conditions, $join->getConditions()); $this->assertTrue($join->isTable()); $this->assertFalse($join->isRelation()); $this->assertEquals(Join::TYPE_TABLE, $join->getType()); } public function testCreate3(): void { $join = Join::create('Test', 'testAlias'); $this->assertEquals('Test', $join->getTarget()); $this->assertEquals('testAlias', $join->getAlias()); } public function testCreate4(): void { $join = Join::createWithSubQuery( SelectBuilder::create() ->select(Expression::value(true)) ->build() , 'a' ); $this->assertTrue($join->isSubQuery()); $this->assertEquals(Join::TYPE_SUB_QUERY, $join->getType()); } }