diff options
author | Silvino Silva <silvino@bk.ru> | 2018-04-03 16:48:07 +0100 |
---|---|---|
committer | Silvino Silva <silvino@bk.ru> | 2018-04-03 16:48:07 +0100 |
commit | e558bcea087aded1cdfac8870f6115e0f4db266b (patch) | |
tree | f5899251714ede9847587d1d7fed454a8d765b83 | |
parent | b55489fd9dae3be02ae166051dc7e5adabb52166 (diff) | |
download | doc-e558bcea087aded1cdfac8870f6115e0f4db266b.tar.gz |
dev php testing
-rw-r--r-- | dev/index.html | 7 | ||||
-rw-r--r-- | dev/php/index.html | 45 |
2 files changed, 51 insertions, 1 deletions
diff --git a/dev/index.html b/dev/index.html index 1f11b84..f9944d9 100644 --- a/dev/index.html +++ b/dev/index.html @@ -155,7 +155,12 @@ <h2>PHP</h2> <ul> - <li><a href="php/index.html">Hello World</a></li> + <li><a href="php/index.html">Hello World</a> + <ul> + <li><a href="php/index.html#profiling">Profiling</a></li> + <li><a href="php/index.html#testing">Testing</a></li> + </ul> + </li> <li><a href="">Types & Variables</a></li> <li><a href="">Operators & Expressions</a></li> <li><a href="">Control Flow</a></li> diff --git a/dev/php/index.html b/dev/php/index.html index a4549f1..45e8f79 100644 --- a/dev/php/index.html +++ b/dev/php/index.html @@ -30,6 +30,51 @@ <p>Open your browser and browse http://localhost:8000, you should see "Hello World".</p> + <h2 id="profiling">Profiling</h2> + + <h2 id="testing">Testing</h2> + + <p>Create folder tests for phpunit files with settings, inside + create another called tests to create tests to be performed on + the code.</p> + + <pre> + $ mkdir -p tests/tests + $ cd tests + </pre> + + <p>Create a test tests/EngineTest.php;</p> + + <pre> + <?php + declare(strict_types=1); + + use PHPUnit\Framework\TestCase; + + final class EngineTest extends TestCase { + + public function testCanBeCreated(){ + + $engine = new engine(); + + $this->assertInstanceOf(engine::class, $engine); + + } + } + </pre> + + <p>Create phpunit.xml;</p> + + <pre> + $ phpunit --generate-configuration + </pre> + + <p>Run the test;</p> + + <pre> + $ phpunit + </pre> + <a href="../index.html">Development Index</a> <p> This is part of the c9-doc Manual. |