PHP code example of waltz / band

1. Go to this page and download the library: Download waltz/band library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

waltz / band example snippets



class HelloWorld {
    /**
     * #test 指定された名前に挨拶する
     * <code>
     * $this->assertSame('Hello Waltz!', $this->_target->hello('Waltz'));
     * </code>
     */
    public function hello($name = 'World') {
        return "Hello {$name}!";
    }
}


class HelloWorld {
    /**
     * #test 指定された名前に挨拶する
     * <code>
     * #eq('Hello Waltz!', #f('Waltz'));
     * #same('Hello Waltz!', #f('Waltz'));
     * #true('Hello Waltz!' === #f('Waltz'));
     * #false('Hello World!' === #f('Waltz'));
     * </code>
     */
    public function hello($name = 'World') {
        return "Hello {$name}!";
    }
}

$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install

$ cd {Project directory}
$ mkdir scripts
$ cp vendor/waltz/band/scripts/simple_test_runner.php scripts/
$ php scripts/simple_test_runner.php {Tests directory}

$ cd {Project directory}
$ vi hello.php
$ mkdir scripts
$ cp vendor/waltz/band/scripts/doctest_runner.php scripts/
$ php scripts/doctest_runner.php hello.php