Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.idea
node_modules
*.o
vendor
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"phpunit/phpunit": "5.5.*"
}
}
6 changes: 6 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites >
<testsuite name="code-problom test suites">
<directory suffix="Test.php">tests/php</directory>
</testsuite>
</testsuites>
17 changes: 17 additions & 0 deletions tests/php/factorialTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
use PHPUnit\Framework\TestCase;

require_once 'solutions/php/factorial.php';

class StackTest extends TestCase
{
public function test_factorial()
{
$this->assertEquals(1,factorial(1) );
$this->assertEquals(2,factorial(2) );
$this->assertEquals(6,factorial(3) );
$this->assertEquals(120,factorial(5) );
$this->assertEquals(2432902008176640000,factorial(20) );
}
}
?>