PHP code example of hotel-quickly / nette-phpunit

1. Go to this page and download the library: Download hotel-quickly/nette-phpunit 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/ */

    

hotel-quickly / nette-phpunit example snippets


use HQ\Test\AbstractDbTestCase;
use HQ\Test\Connection\NetteConnection;

class YourBaseDbTestCase extends AbstractDbTestCase
{
    protected function getContainer()
    {
        return se.default.context'))
        ];
    }

    public function getBaseFixtureDir()
    {
        return __DIR__;
    }
}

class MyTest extends MyBaseDbTestCase
{
    public function getFixtures()
    {
        return [
            '<connection-name>' => [
                ...
            ]
        ]
    }
}

return [
    'user' => [
        ['username' => 'john'],
        ['username' => 'jane'],
    ]
]
txt
test
  +- YourBaseDbTestCase.php
  +- <connection-name>-fixtures.{yaml, json, php} e.g. default-fixtures.json 
txt
test
  +- User
    +- UserTest.php
    +- <connection-name>-fixtures.{yaml, json, php} e.g. default-fixtures.json