Commits

Isidro Merayo Castellano committed 61ad7b9

implement sayHello('Fabien')

  • Participants
  • Parent commits 62a411c

Comments (0)

Files changed (3)

 Create your test under "tests" directory.
 Create your code under "src" directory.
 
-$ phpunit -c tests/
+$ phpunit -c tests/
+
+If you use Netbeans PHP, configure in 
+Project properties -> sources -> Test Folder: tests (Alt + F6 to run)
+
+You should remove "Acme" namespace ;)

src/Acme/Dummy.php

 <?php
 namespace Acme;
+
 /**
  * Dummy class
  *
  */
 class Dummy 
 {
-
+    static public function sayHello($name)
+    {
+        return 'Hello ' . $name;
+    }
 }

tests/Acme/DummyTest.php

     /**
      * @test
      */
-    public function sayHello()
+    public function sayHelloFabien()
     {
-        $this->markTestIncomplete('TODO');
+        $expected = 'Hello Fabien';
+        $actual = Dummy::sayHello('Fabien');
+        $this->assertEquals($expected, $actual);
     }
 }