public function testTernary() { $t = new \Test\Ternary(); $this->assertEquals(101, $t->testTernary1()); $this->assertEquals('foo', $t->testTernary2(true)); $this->assertEquals('bar', $t->testTernary2(false)); $this->assertEquals(3, $t->testTernaryAfterLetVariable()); }
public function testTernary() { $t = new \Test\Ternary(); $this->assertEquals(101, $t->testTernary1()); $this->assertEquals('foo', $t->testTernary2(true)); $this->assertEquals('bar', $t->testTernary2(false)); $this->assertEquals(3, $t->testTernaryAfterLetVariable()); $this->assertEquals(array('', 'c', ''), $t->testTernaryWithPromotedTemporaryVariable()); }
public function testTernary() { $t = new \Test\Ternary(); $this->assertSame(101, $t->testTernary1()); $this->assertSame('foo', $t->testTernary2(true)); $this->assertSame('bar', $t->testTernary2(false)); $this->assertSame(3, $t->testTernaryAfterLetVariable()); $this->assertSame(array('', 'c', ''), $t->testTernaryWithPromotedTemporaryVariable()); $this->assertSame(true, $t->testShortTernary(true)); $this->assertSame(false, $t->testShortTernary(array())); $this->assertSame(array(1, 2, 3), $t->testShortTernary(array(1, 2, 3))); $this->assertSame(false, $t->testShortTernary(false)); $this->assertSame(false, $t->testShortTernary(0)); $this->assertSame(1, $t->testShortTernaryComplex(false, 1)); $this->assertSame("test string", $t->testShortTernaryComplex(false, "test string")); $this->assertSame(array(), $t->testShortTernaryComplex(false, array())); }