diff --git a/.gitignore b/.gitignore index a59ae71..a8dec1e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .idea node_modules *.o +vendor diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..65658fb --- /dev/null +++ b/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "phpunit/phpunit": "5.5.*" + } +} diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..ae3c20e --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,6 @@ + + + + tests/php + + \ No newline at end of file diff --git a/tests/php/factorialTest.php b/tests/php/factorialTest.php new file mode 100644 index 0000000..437a2f4 --- /dev/null +++ b/tests/php/factorialTest.php @@ -0,0 +1,17 @@ +assertEquals(1,factorial(1) ); + $this->assertEquals(2,factorial(2) ); + $this->assertEquals(6,factorial(3) ); + $this->assertEquals(120,factorial(5) ); + $this->assertEquals(2432902008176640000,factorial(20) ); + } +} +?> \ No newline at end of file