Skip to content

Instantly share code, notes, and snippets.

@indare
Created April 2, 2012 04:32
Show Gist options
  • Save indare/2280760 to your computer and use it in GitHub Desktop.
Save indare/2280760 to your computer and use it in GitHub Desktop.
phpの闇
<?php
require_once 'PHPUnit/Autoload.php';
class testBoolCheck extends PHPUnit_Framework_TestCase {
public function testBoolCheck_1(){
$this->assertEquals(is_bool(-1),false);
}
public function testBoolCheck_2(){
$this->assertEquals(is_bool(0),false);
}
public function testBoolCheck_3(){
$this->assertEquals(is_bool((bool)(-1)),true);
}
public function testBoolCheck_4(){
$this->assertEquals(is_bool((bool)(0)),true);
}
public function testBoolCheck_5(){
$this->assertEquals(0,false);
}
public function testBoolCheck_6(){
$this->assertEquals(0.0,false);
}
public function testBoolCheck_7(){
$this->assertEquals(-1,true);
}
public function testBoolCheck_8(){
$this->assertEquals(1,true);
}
public function testBoolCheck_9(){
$this->assertEquals(2,true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment