ninjify / nunjuck
Special tuned version of nette/tester for your PHP projects
Installs: 157 452
Dependents: 213
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.1
- nette/tester: ^2.3
Requires (Dev)
- janmarek/mockista: ^1.1.0
- mockery/mockery: ^1.2.2
- nette/di: ~2.4.15
- nette/robot-loader: ~3.2.0
- ninjify/qa: ^0.10
Suggests
- janmarek/mockista: to use BaseMockistaTestCase
- mockery/mockery: to use BaseMockeryTestCase
- nette/di: to use BaseContainerTestCase
README
Special tuned nette/tester for your PHP projects.
Install
composer require --dev ninjify/nunjuck
Versions
State | Version | Branch | PHP |
---|---|---|---|
dev | ^0.3.0 |
master |
>= 7.1 |
stable | ^0.2.1 |
master |
>= 7.1 |
Usage
Environment
use Ninjify\Nunjuck\Environment; # Configure Nette\Tester Environment::setupTester(); # Configure timezone (Europe/Prague by default) Environment::setupTimezone(); # Configure many constants Environment::setupVariables(); # Fill global variables Environment::setupGlobalVariables(); # Register robot loader Environment::setupRobotLoader(); Environment::setupRobotLoader(function($loader){});
TestCases
There are many predefined test cases.
BaseTestCase
BaseMockeryTestCase
+TMockeryTestCase
BaseMockistaTestCase
+TMockistaTestCase
BaseContainerTestCase
+TContainerTestCase
Toolkit
Toolkit
is class for handling anonymous tests functions.
Toolkit::setUp(function() { ... })
is called before test function.Toolkit::tearDown(function() { ... })
is after before test function.Toolkit::bind($object)
binds new context into test function, you can access$this->
inside.Toolkit::test(function() { ... })
triggers test function.
Notes
Little helper to your tests.
use Ninjify\Nunjuck\Notes; Notes::add('My note'); # ['My note'] $notes = Notes::fetch(); Notes::clear();
Thanks for testing, reporting and contributing.