Created
October 7, 2011 14:35
-
-
Save s4l1h/1270397 to your computer and use it in GitHub Desktop.
PHPUnit Örneği
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . '/usr/lib/php'); | |
require_once 'PHPUnit/Autoload.php'; | |
class Test extends PHPUnit_Framework_TestCase | |
{ | |
public $dizi=array(); | |
public $ad = NULL; | |
public function test1() | |
{ | |
$this->assertEquals(0, sizeof($this->dizi)); | |
} | |
public function test2() | |
{ | |
$this->setAd('Test'); | |
$this->assertTrue($this->checkAd()); | |
} | |
private function setAd($ad) | |
{ | |
$this->ad = $ad; | |
} | |
private function checkAd() | |
{ | |
return $this->ad !== NULL ? TRUE : FALSE; | |
} | |
} | |
/* | |
Mac-mini$ phpunit Test.php | |
PHPUnit 3.5.15 by Sebastian Bergmann. | |
.. | |
Time: 0 seconds, Memory: 2.75Mb | |
OK (2 tests, 2 assertions) | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment