Skip to content

Instantly share code, notes, and snippets.

@Fuco1
Created June 21, 2017 13:47
Show Gist options
  • Save Fuco1/71c009e79922255ec2843e72c24c8c2e to your computer and use it in GitHub Desktop.
Save Fuco1/71c009e79922255ec2843e72c24c8c2e to your computer and use it in GitHub Desktop.
$configurator->createRobotLoader()
->addDirectory($appDir)
->addDirectory(__DIR__ . '/Utils')
->register();
// zmenit na => (pridat .phpt scan)
$robotLoader = $configurator->createRobotLoader();
$robotLoader->acceptFiles = '*.php, *.phpt';
$robotLoader->addDirectory($appDir)
->addDirectory(__DIR__)
->register();
<?php
namespace Tests\Entity;
class CampaignTest extends Tester\TestCase
{
private $entityManager;
public function __construct(Kdyby\Doctrine\EntityManager $entityManager)
{
$this->entityManager = $entityManager;
}
public function testModifyLastActivatedAt() { ... }
}
if (getenv(Tester\Environment::RUNNER)) {
$container = require_once __DIR__ . '/../container.php';
(new CampaignTest($container->getByType(Kdyby\Doctrine\EntityManager::class)))->run();
}
<?php
namespace Tests\Entity;
$container = require_once __DIR__ . '/../container.php';
class CampaignTest extends Tester\TestCase
{
private $entityManager;
public function __construct(Kdyby\Doctrine\EntityManager $entityManager)
{
$this->entityManager = $entityManager;
}
public function testModifyLastActivatedAt() { ... }
}
(new CampaignTest($container->getByType(Kdyby\Doctrine\EntityManager::class)))->run();
parameters:
bootstrap: %rootDir%/../../../tests/php/container.php # < cesta k boostrap fajlu ktery se pouziva v testech pro ziskani containeru
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment