示例#1
0
 public function testIf()
 {
     $t = new \Test\Flow();
     $this->assertSame($t->testIf1(), 1);
     $this->assertSame($t->testIf2(), 0);
     $this->assertSame($t->testIf3(), 1);
     $this->assertSame($t->testIf4(), 0);
     $this->assertSame($t->testIf5(), 1);
     $this->assertSame($t->testIf6(), 0);
     $this->assertSame($t->testIf7(), 1);
     $this->assertSame($t->testIf8(), 0);
     $this->assertSame($t->testIf9(), 1);
     $this->assertSame($t->testIf10(), 654);
     $this->assertSame($t->testIf12(), 987);
     $this->assertSame($t->testIf13(), -12);
     $this->assertSame($t->testIf14(), 74);
     $this->assertSame($t->testIf15(), 89);
     $this->assertTrue($t->testIf16(array()));
     $this->assertTrue($t->testIf16(''));
     $this->assertTrue($t->testIf16(null));
     $this->assertFalse($t->testIf16(' '));
 }
示例#2
0
 public function testIf()
 {
     $t = new \Test\Flow();
     $this->assertTrue($t->testIf1() === 1);
     $this->assertTrue($t->testIf2() === 0);
     $this->assertTrue($t->testIf3() === 1);
     $this->assertTrue($t->testIf4() === 0);
     $this->assertTrue($t->testIf5() === 1);
     $this->assertTrue($t->testIf6() === 0);
     $this->assertTrue($t->testIf7() === 1);
     $this->assertTrue($t->testIf8() === 0);
     $this->assertTrue($t->testIf9() === 1);
     $this->assertTrue($t->testIf10() === 654);
     $this->assertTrue($t->testIf12() === 987);
     $this->assertTrue($t->testIf13() === -12);
     $this->assertTrue($t->testIf14() === 74);
     $this->assertTrue($t->testIf15() === 89);
     $this->assertTrue($t->testIf16(array()) === true);
     $this->assertTrue($t->testIf16('') === true);
     $this->assertTrue($t->testIf16(null) === true);
     $this->assertTrue($t->testIf16(' ') === false);
 }