public function setUp()
 {
     parent::setUp();
     $this->loadFixtures(["Dende\\Bundle\\AppBundle\\DataFixtures\\ORM\\TasksData", "Dende\\Bundle\\AppBundle\\DataFixtures\\ORM\\TodoListsData"]);
     $this->client = static::makeClient();
     $this->client->followRedirects(true);
 }
示例#2
0
 /**
  * Test set up
  */
 public function setUp()
 {
     parent::setUp();
     $this->client = static::createClient(array(), array('PHP_AUTH_USER' => 'jumph', 'PHP_AUTH_PW' => 'jumphpassword'));
     $fixtures = array('Jumph\\Bundle\\UserBundle\\DataFixtures\\ORM\\LoadUserData', 'Jumph\\Bundle\\EmailBundle\\DataFixtures\\ORM\\LoadEmailData', 'Jumph\\Bundle\\ClientBundle\\DataFixtures\\ORM\\LoadCompanyData', 'Jumph\\Bundle\\ClientBundle\\DataFixtures\\ORM\\LoadEmployeeData', 'Jumph\\Bundle\\ProjectBundle\\DataFixtures\\ORM\\LoadProjectData', 'Jumph\\Bundle\\ProjectBundle\\DataFixtures\\ORM\\LoadProjectStatusData', 'Jumph\\Bundle\\TimeTrackerBundle\\DataFixtures\\ORM\\LoadTimeTrackerData', 'Jumph\\Bundle\\TimeTrackerBundle\\DataFixtures\\ORM\\LoadTimeCategoryData');
     $this->loadFixtures($fixtures);
 }
示例#3
0
 protected function setUp()
 {
     parent::setUp();
     $this->loadFixtures($this->getFixtureFullClassNames());
     if (!static::$client) {
         static::$client = static::makeClient($authentication = true);
     }
 }
 public function tearDown()
 {
     foreach ($this->client->getContainer()->getMockedServices() as $id => $service) {
         $this->client->getContainer()->unmock($id);
     }
     m::close();
     parent::tearDown();
 }
 /**
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->faker = $this->getContainer()->get("hautelook_alice.faker");
     error_reporting(E_ALL & ~E_USER_DEPRECATED);
     $this->client = static::makeClient();
     $this->client->followRedirects(true);
     $this->fixtures = $this->loadFixtureFiles(['@AppBundle/DataFixtures/ORM/test/calendars.yml', '@AppBundle/DataFixtures/ORM/test/events.yml', '@AppBundle/DataFixtures/ORM/test/occurrences.yml', '@AppBundle/DataFixtures/ORM/test/workshops.yml', '@AppBundle/DataFixtures/ORM/test/lessons.yml']);
 }
 public function setUp()
 {
     //Load fixtures
     $fixtures = array('Mvc\\BlogBundle\\DataFixtures\\ORM\\LoadPostsData');
     $this->loadFixtures($fixtures);
     $this->client = static::createClient();
     $this->container = $this->client->getContainer();
     parent::setUp();
 }
示例#7
0
 /**
  * Do not EVER forget to call parent::tearDown() if you override this method!
  */
 public function tearDown()
 {
     if ($this->getEntityManager()) {
         $this->getEntityManager()->rollback();
         $conn = $this->getEntityManager()->getConnection();
         $conn->close();
     }
     parent::tearDown();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->client = $this->createClient([], ['CONTENT_TYPE' => 'application/json', 'HTTP_ACCEPT' => 'application/json']);
     $this->jsonDecoder = new JsonDecode(true);
     $this->jsonEncoder = new JsonEncode();
     $fixtures = [LoadUserData::class, LoadPhoneNumberData::class];
     $this->loadFixtures($fixtures);
 }
 public function setUp()
 {
     //Load fixtures
     $fixtures = ['Mvc\\BlogBundle\\DataFixtures\\ORM\\LoadPostsData'];
     $this->loadFixtures($fixtures);
     $this->client = static::createClient();
     $this->container = $this->client->getContainer();
     $this->manager = $this->container->get('mk.tag_manager');
     $this->em = static::$kernel->getContainer()->get('doctrine')->getManager();
     parent::setUp();
 }
 public function setUp()
 {
     $this->client = static::createClient();
     $this->container = $this->client->getContainer();
     $this->manager = $this->container->get('mykees.comment.manager');
     $this->query_manager = $this->container->get('mykees.comment.query.manager');
     $this->em = static::$kernel->getContainer()->get('doctrine')->getManager();
     $fixtures = ['Mykees\\CommentBundle\\DataFixtures\\ORM\\LoadCommentData', 'Mvc\\BlogBundle\\DataFixtures\\ORM\\LoadPostsData'];
     $this->loadFixtures($fixtures);
     parent::setUp();
 }
示例#11
0
 protected static function getKernelClass()
 {
     $dir = isset($_SERVER['KERNEL_DIR']) ? $_SERVER['KERNEL_DIR'] : self::getPhpUnitXmlDir();
     $class = 'AppKernel';
     $file = $dir . '/' . $class . '.php';
     if (!file_exists($file)) {
         return parent::getKernelClass();
     }
     require_once $file;
     return $class;
 }
 /**
  * Test "Edit and save a scheduling"
  */
 public function testEditSave()
 {
     //DataFixtures create 4 records
     $this->loadFixtures(array('JMose\\CommandSchedulerBundle\\Fixtures\\ORM\\LoadScheduledCommandData'));
     $client = parent::createClient();
     $client->followRedirects(true);
     $crawler = $client->request('GET', '/command-scheduler/detail/edit/1');
     $buttonCrawlerNode = $crawler->selectButton('Save');
     $form = $buttonCrawlerNode->form();
     $form->get('command_scheduler_detail[name]')->setValue('edited one');
     $crawler = $client->submit($form);
     $this->assertEquals(4, $crawler->filter('a[href^="/command-scheduler/action/toggle/"]')->count());
     $this->assertEquals("edited one", trim($crawler->filter('td')->eq(1)->text()));
 }
 /**
  * Do not EVER forget to call parent::tearDown() if you override this method!
  */
 public function tearDown()
 {
     /** @var EntityManagerInterface $manager */
     foreach ($this->getContainer()->get('doctrine')->getManagers() as $manager) {
         $manager->rollback();
         $manager->close();
         $connection = $manager->getConnection();
         if ($connection instanceof \ParaunitTestCase\Connection\Connection) {
             $connection->closeForReal();
         } elseif (method_exists($connection, 'close')) {
             $connection->close();
         }
     }
     parent::tearDown();
 }
示例#14
0
 public function setUp()
 {
     parent::setUp();
     $em = $this->getContainer()->get('doctrine')->getManager();
     if (!isset($metadatas)) {
         $metadatas = $em->getMetadataFactory()->getAllMetadata();
     }
     $schemaTool = new SchemaTool($em);
     $schemaTool->dropDatabase();
     if (!empty($metadatas)) {
         $schemaTool->createSchema($metadatas);
     }
     $this->postFixtureSetup();
     $fixtures = [];
     $this->loadFixtures($fixtures);
     $this->gameRepository = new GameRepository($em);
 }
 public function tearDown()
 {
     parent::tearDown();
     $this->client = null;
 }
示例#16
0
 /**
  * @inheritdoc
  */
 protected function tearDown()
 {
     self::runCommand('doctrine:schema:drop', ['--force' => true]);
     parent::tearDown();
 }
 public function tearDown()
 {
     parent::tearDown();
     unset($this->display);
 }
示例#18
0
 /**
  * {@inheritdoc}
  */
 protected function tearDown()
 {
     parent::tearDown();
     $this->em->close();
     unset($this->em, $this->container, $this->client, $this->encoder);
 }
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $this->client = static::makeClient();
 }
示例#20
0
 /**
  * setup this test
  * for fixtures path, you typically use something like __DIR__/../Fixtures/
  *
  * @param string $fixturesPath the path to the directory with the fixture xmls for testing.
  */
 public function __construct($fixturesPath)
 {
     parent::__construct();
     $this->importexport = new \JackrabbitFixtureLoader($fixturesPath);
 }
示例#21
0
 /**
  * Set up repository test
  */
 public function setUp()
 {
     parent::setUp();
     $this->loadFixtures(array('UBC\\Exam\\MainBundle\\Tests\\Fixtures\\ExamFixtures'));
 }
示例#22
0
 /**
  * {@inheritdoc}
  */
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     $testToken = getenv('TEST_TOKEN');
     $this->environment = $testToken ? sprintf('test_%s', $testToken) : 'test';
 }
 protected function tearDown()
 {
     parent::tearDown();
 }
示例#24
0
 public function tearDown()
 {
     parent::tearDown();
     $this->em->clear();
     $this->em->close();
     foreach ($this->dataFiles() as $src => $dst) {
         $path = self::DSTDIR . '/' . $dst;
         if (file_exists($path)) {
             if (is_dir($path)) {
                 $this->delTree($path);
             } else {
                 unlink($path);
             }
         }
     }
 }
 /**
  * {@inheritDoc}
  * @see PHPUnit_Framework_TestCase::setUp()
  */
 public function setUp()
 {
     parent::setUp();
     $this->fixtures = $this->loadFixtureFiles(array('@ASFUserBundle/DataFixtures/ORM/User.yml'));
 }
示例#26
0
 public function setUp()
 {
     parent::setUp();
     $this->client = static::createClient(array(), array('PHP_AUTH_USER' => 'admin', 'PHP_AUTH_PW' => 'pass'));
     $this->loadFixtures(array('UBC\\Exam\\MainBundle\\Tests\\Fixtures\\ExamFixtures'));
 }
 protected function tearDown()
 {
     $this->loadFixtures(array());
     $this->getContainer()->get('doctrine')->getConnection()->close();
     parent::tearDown();
 }
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
 }
 /**
  * {@inheritDoc}
  */
 protected function tearDown()
 {
     parent::tearDown();
     $this->em->close();
 }
 /**
  * call a URL, follow redirects
  *
  * @param string $method GET|POST
  * @param string $url URL
  * @param string $return crawler|response to return either a \Symfony\Component\DomCrawler\Crawler or a \Symfony\Component\HttpFoundation\Response
  *
  * @return mixed
  */
 protected function callUrl($method, $url, $return = 'crawler')
 {
     $client = parent::createClient();
     $client->followRedirects(true);
     $crawler = $client->request($method, $url);
     $response = $client->getResponse();
     return ${$return};
 }