ninjify/nunjuck

Special tuned version of nette/tester for your PHP projects

v0.4.0 2023-03-14 13:58 UTC

This package is auto-updated.

Last update: 2024-03-14 16:38:12 UTC


README

68747470733a2f2f62616467656e2e6e65742f6769746875622f636865636b732f6e696e6a6966792f6e756e6a75636b2f6d61737465723f63616368653d333030 68747470733a2f2f62616467656e2e6e65742f636f766572616c6c732f632f6769746875622f6e696e6a6966792f6e756e6a75636b3f63616368653d333030 68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f646d2f6e696e6a6966792f6e756e6a75636b 68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f6e696e6a6966792f6e756e6a75636b

68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f6e696e6a6966792f6e756e6a75636b 68747470733a2f2f62616467656e2e6e65742f6769746875622f6c6963656e73652f6e696e6a6966792f6e756e6a75636b 68747470733a2f2f62616467656e2e6e65742f62616467652f737570706f72742f6769747465722f6379616e 68747470733a2f2f62616467656e2e6e65742f62616467652f737570706f72742f666f72756d2f79656c6c6f77 68747470733a2f2f62616467656e2e6e65742f62616467652f73706f6e736f722f646f6e6174696f6e732f463936383534

Website 🚀 contributte.org | Contact 👨🏻‍💻 f3l1x.io | Twitter 🐦 @contributte

Usage

To install latest version of ninjify/nunjuck use Composer.

composer require --dev ninjify/nunjuck

Versions

State Version Branch PHP
dev ^0.5.0 master >= 7.1
stable ^0.4.0 master >= 7.1

Documentation

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();

Development

See how to contribute to this package. This package is currently maintained by these authors.

538058?v=3&s=80

Consider to support contributte development team. Also thank you for using this package.