bootstrap.php 738 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. declare(strict_types=1);
  3. use Tester\Assert;
  4. // The Nette Tester command-line runner can be
  5. // invoked through the command: ../vendor/bin/tester .
  6. if (@!include __DIR__ . '/../vendor/autoload.php') {
  7. echo 'Install Nette Tester using `composer install`';
  8. exit(1);
  9. }
  10. // configure environment
  11. Tester\Environment::setup();
  12. date_default_timezone_set('Europe/Prague');
  13. function test(string $title, Closure $function): void
  14. {
  15. $function();
  16. }
  17. function checkValidationErrors(Closure $function, array $messages): Nette\Schema\ValidationException
  18. {
  19. $e = Assert::exception($function, Nette\Schema\ValidationException::class);
  20. Assert::same($messages, $e->getMessages());
  21. Assert::same($messages[0], $e->getMessage());
  22. return $e;
  23. }