about summary refs log blame commit diff stats
path: root/dev/php/index.html
blob: fdb2b098158b85f83fc0cadf3945a878cff02d81 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                     




















                                                                  












































                                                                      

                                                     

                                                      
                  







                                                                                               
<!DOCTYPE html>
<html dir="ltr" lang="en">
    <head>
        <meta charset='utf-8'>
        <title>c9 PHP</title>
    </head>
    <body>
        <a href="../index.html">Development Index</a>

        <h1>c9 PHP</h1>


        <h2>Hello World</h2>

        <p>PHP comes with a built in server that helps to speed up
        developing by not having to configure a system web server,
        first create file index.php;</p>

        <pre>
        &lt;?php
           echo "Hello World";
        </pre>

        <p>Now run the server;</p>

        <pre>
        $ php -S localhost:8000
        </pre>

        <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>
       &lt;?php
        declare(strict_types=1);

        use PHPUnit\Framework\TestCase;

        final class EngineTest extends TestCase {

            public function testCanBeCreated(){

                   $engine = new engine();

                   $this-&gt;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 Hive System Documentation.
        Copyright (C) 2018
        Hive Team.
        See the file <a href="../../fdl-1.3-standalone.html">Gnu Free Documentation License</a>
        for copying conditions.</p>


    </body>

</html>