Witam,
próbuję pobawić się testami jednostkowymi, ale coś mi nie idzie sad.gif
Mój plik index.php prezentuje się tak:
  1. <?php
  2. class KlasaDoTestowania {
  3. private $var;
  4. public function set($var){
  5. $this->var = $var;
  6. }
  7. public function getInt(){
  8. return intval($this->var);
  9. }
  10. public function getString(){
  11. return $this->var."";
  12. }
  13. }
  14.  
  15. require_once("PHPUnit/phpunit.php");
  16.  
  17. class Testujaca extends PHPUnit_TestCase{
  18.  
  19. private $ob;
  20.  
  21. function setUp(){
  22. $this->ob = new KlasaDoTestowania();
  23. $this->ob->set("15");
  24. }
  25.  
  26. function tearDown(){
  27. unset($this->ob);
  28. }
  29.  
  30. public function testGetInt(){
  31. $result = $this->ob->getInt();
  32. $this->assertTrue($result == 15);
  33. }
  34.  
  35. }
  36.  
  37. $suite = new PHPUnit_TestSuite("Testujaca");
  38. $result = PHPUnit::run($suite);
  39.  
  40. echo $result -> toHTML();
  41.  
  42. ?>

W tym samym katalogu mam pobranego PHPUnit'a z repozytorium.
Plik, który jest dołączany (PHPUnit/phpunit.php) ma taką zawartość:
  1. #!/usr/bin/env php
  2. <?php
  3. /* PHPUnit
  4.  *
  5.  * Copyright (c) 2001-2012, Sebastian Bergmann <sebastian@phpunit.de>.
  6.  * All rights reserved.
  7.  * ...
  8.  */
  9.  
  10. define('PHPUnit_MAIN_METHOD', 'PHPUnit_TextUI_Command::main');
  11.  
  12. if (strpos('@php_bin@', '@php_bin') === 0) {
  13. require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'PHPUnit' . DIRECTORY_SEPARATOR . 'Autoload.php';
  14. } else {
  15. require '@php_dir@' . DIRECTORY_SEPARATOR . 'PHPUnit' . DIRECTORY_SEPARATOR . 'Autoload.php';
  16. }
  17.  
  18. PHPUnit_TextUI_Command::main();

Co oznacza '@php_bin@'?
Po odpaleniu pliku ./index.php wyświetla mi się tylko pierwsza linijka z powyższego pliku
Jak powinna wyglądać kompletna instalacja i konfiguracja? Dodam, że phpunit z Terminala działa.