Ejemplo n.º 1
0
 public function tearDown()
 {
     parent::tearDown();
     $this->app['orm.em']->getConnection()->close();
     $this->app = null;
     $this->client = null;
 }
 public function setUp()
 {
     parent::setUp();
     $this->app->get('/exception', function () {
         throw new IAmATeaPodException();
     })->bind('exception');
 }
Ejemplo n.º 3
0
 public function tearDown()
 {
     parent::tearDown();
     foreach ($this->dataInsertUser as $dataUser) {
         $this->app['user.service']->destroy($dataUser['name']);
     }
 }
Ejemplo n.º 4
0
 /**
  * トランザクションをロールバックする.
  */
 public function tearDown()
 {
     parent::tearDown();
     $this->app['orm.em']->getConnection()->rollback();
     $this->app['orm.em']->getConnection()->close();
     $this->cleanUpProperties();
 }
Ejemplo n.º 5
0
 public function tearDown()
 {
     parent::tearDown();
     $this->app['storage']->close();
     $fs = new Filesystem();
     $fs->remove($this->baseDir);
 }
Ejemplo n.º 6
0
 public function setUp()
 {
     parent::setUp();
     if ($this->client === null) {
         $this->client = $this->createClient();
     }
     $this->client->followRedirects();
 }
 /** {@inheritdoc} */
 protected function tearDown()
 {
     $this->client = null;
     $this->jsonResponseData = null;
     $this->books = null;
     $this->reservations = null;
     parent::tearDown();
 }
 public function setUp()
 {
     parent::setUp();
     $this->app->get('/redirect', function () {
         return new RedirectRoute('dummy');
     })->bind('redirectTo');
     $this->app->get('/dummy', function () {
         return new Response();
     })->bind('dummy');
 }
Ejemplo n.º 9
0
 public function setUp()
 {
     parent::setUp();
     $this->app->get('/closure', function () {
         return [];
     });
     // This only works with full qualified namespaces! In this case we dont use a namespace
     $this->app->get('/namespace', sprintf('%s::dummyAction', DummyController::class));
     $this->app->get('/service', 'dummy.controller:dummyAction');
 }
Ejemplo n.º 10
0
 /**
  * トランザクションをロールバックする.
  */
 public function tearDown()
 {
     parent::tearDown();
     if (!$this->isSqliteInMemory()) {
         $this->app['orm.em']->getConnection()->rollback();
         $this->app['orm.em']->getConnection()->close();
     }
     $this->cleanUpProperties();
     $this->app = null;
 }
Ejemplo n.º 11
0
 public function setUp()
 {
     parent::setUp();
     $this->app->boot();
     $this->app['session.storage'] = new MockArraySessionStorage();
     /** @var Database $db */
     $db = $this->app['mongodb.database'];
     $db->selectCollection('gateway_configs')->deleteMany([]);
     $db->selectCollection('security_tokens')->deleteMany([]);
     $db->selectCollection('payments')->deleteMany([]);
 }
Ejemplo n.º 12
0
 /**
  * @link http://stackoverflow.com/questions/13537545/clear-memory-being-used-by-php
  */
 public function tearDown()
 {
     parent::tearDown();
     $this->app['orm.em']->getConnection()->close();
     $refl = new \ReflectionObject($this);
     foreach ($refl->getProperties() as $prop) {
         if (!$prop->isStatic() && 0 !== strpos($prop->getDeclaringClass()->getName(), 'PHPUnit_')) {
             $prop->setAccessible(true);
             $prop->setValue($this, null);
         }
     }
 }
Ejemplo n.º 13
0
 public function setUp()
 {
     parent::setUp();
     // set user
     $user = array("email" => "*****@*****.**", "password" => "f71dbe52628a3f83a77ab494817525c6");
     $this->app['user_service']->create($user);
     // set pictures
     $item1 = array("id" => "354", "file" => "2013_05_26_3561.JPG", "description" => "Bienvenue Alice !", "date" => "2013-05-26 17:04:17", "like" => "0", "ratio" => "1.499531", "reverseRatio" => "0.666875", "type" => "picture");
     $item2 = array("id" => "334", "file" => "2013_05_19_3325.JPG", "description" => "La East side galerie", "date" => "2013-05-19 11:02:09", "like" => "0", "ratio" => "1.392515", "reverseRatio" => "0.718125", "type" => "picture");
     $this->app['picture_service']->insert($item1);
     $this->app['picture_service']->insert($item2);
 }
Ejemplo n.º 14
0
 public function setUp()
 {
     parent::setUp();
     exec(__DIR__ . '/../vendor/bin/phinx migrate -e testing');
     $item = Model::factory('Todo\\Model\\Item');
     $item->delete_many();
     ORM::for_table('SQLITE_SEQUENCE')->raw_execute("delete from SQLITE_SEQUENCE where name='item';");
     $item->create();
     $item->title = 'Test title';
     $item->done = false;
     $item->save();
 }
Ejemplo n.º 15
0
 public function setUp()
 {
     parent::setUp();
     // truncate tables
     $this->app['orm.em']->getConnection()->query('START TRANSACTION;
         SET FOREIGN_KEY_CHECKS=0;
         TRUNCATE user;
         TRUNCATE account;
         TRUNCATE account_transaction;
         TRUNCATE currency;
         SET FOREIGN_KEY_CHECKS=1; COMMIT;');
     // Run fixtures to populate database
     $loader = new DataLoader();
     $loader->load($this->app['orm.em']);
 }
Ejemplo n.º 16
0
 public function setUp()
 {
     parent::setUp();
     if ($this->app['config']['database']['driver'] == 'pdo_sqlite') {
         // Connection が別物になってしまうため
         $this->markTestSkipped('Can not support for sqlite3');
     }
     $c = $this->app['controllers_factory'];
     $c->match('/tran1', '\\Eccube\\Tests\\Transaction\\TransactionControllerMock::tran1')->bind('tran1');
     $c->match('/tran2', '\\Eccube\\Tests\\Transaction\\TransactionControllerMock::tran2')->bind('tran2');
     $c->match('/tran3', '\\Eccube\\Tests\\Transaction\\TransactionControllerMock::tran3')->bind('tran3');
     $c->match('/tran4', '\\Eccube\\Tests\\Transaction\\TransactionControllerMock::tran4')->bind('tran4');
     $c->match('/tran5', '\\Eccube\\Tests\\Transaction\\TransactionControllerMock::tran5')->bind('tran5');
     $c->match('/tran6', '\\Eccube\\Tests\\Transaction\\TransactionControllerMock::tran6')->bind('tran6');
     $c->match('/tran7', '\\Eccube\\Tests\\Transaction\\TransactionControllerMock::tran7')->bind('tran7');
     $c->match('/tran8', '\\Eccube\\Tests\\Transaction\\TransactionControllerMock::tran8')->bind('tran8');
     $c->match('/tran9', '\\Eccube\\Tests\\Transaction\\TransactionControllerMock::tran9')->bind('tran9');
     $this->app->mount('', $c);
 }
 public function setUp()
 {
     parent::setUp();
     $this->app->get('/flash', function (Flash $flashBag) {
         $flashBag->add('error', 'flashy');
         return new Response('flash added');
     });
     $this->app->get('/security', function (TokenContext $context) {
         if ($context->hasNonAnonymousToken()) {
             $userName = $context->getCurrentUser()->getUsername();
             return new Response(sprintf('user: %s', $userName));
         } else {
             return new Response('anonymous user');
         }
     });
     $this->app->get('/form', function (FormRequest $formRequest) {
         $formRequest->handle(TextType::class);
         return new Response('form handled');
     });
 }
Ejemplo n.º 18
0
 public function setUp()
 {
     global $app;
     try {
         /* delete the existing entities before each test */
         /* if we delete the entities the ids go out of sync, which means the data 
          * in the fixures is not what the tests expect - guess we should use mocks 
          * but I find that messy */
         /* so we kill the whole db before each test and then reload the fixtures */
         self::setUpBeforeClass();
         /* load the fixtures */
         $loader = new Loader();
         $loader->loadFromDirectory('config/doctrine/fixtures/');
         $fixtures = $loader->getFixtures();
         $purger = new ORMPurger($app['orm.em']);
         $purger->setPurgeMode(ORMPurger::PURGE_MODE_DELETE);
         $executor = new ORMExecutor($app['orm.em'], $purger);
         $executor->execute($fixtures);
     } catch (\Exception $e) {
         /* ignored */
     }
     parent::setUp();
 }
Ejemplo n.º 19
0
 public function setUp()
 {
     parent::setUp();
     $this->client = $this->createClient();
     $this->client->followRedirects(true);
 }
Ejemplo n.º 20
0
 public function tearDown()
 {
     ACLProvider::purge();
     \collection::purge();
     \databox::purge();
     \caption_field::purge();
     \caption_Field_Value::purge();
     \databox_field::purge();
     \databox_status::purge();
     \thesaurus_xpath::purge();
     /**
      * Kris Wallsmith pro-tip
      * @see http://kriswallsmith.net/post/18029585104/faster-phpunit
      */
     $refl = new ReflectionObject($this);
     foreach ($refl->getProperties() as $prop) {
         if (!$prop->isStatic() && 0 !== strpos($prop->getDeclaringClass()->getName(), 'PHPUnit_') && 0 !== strpos($prop->getDeclaringClass()->getName(), 'Phraseanet')) {
             $prop->setAccessible(true);
             $prop->setValue($this, null);
         }
     }
     $refl = null;
     parent::tearDown();
     //In case some executed script modify 'max_execution_time' ini var
     //Initialize set_time_limit(0) which is the default value for PHP CLI
     set_time_limit(0);
 }
 public function setUp()
 {
     parent::setUp();
 }
Ejemplo n.º 22
0
 public function setUp()
 {
     parent::setUp();
     $this->client = $this->createClient();
     $this->urlGenerator = $this->app['url_generator'];
 }
 public function setUp()
 {
     $this->profilerDirectory = sys_get_temp_dir() . '/' . substr(sha1(microtime()), 0, 8);
     mkdir($this->profilerDirectory);
     parent::setUp();
 }
 public function tearDown()
 {
     parent::tearDown();
     $this->app = null;
     $this->client = null;
 }
Ejemplo n.º 25
0
 /**
  * {@inheritdoc}
  */
 protected function tearDown()
 {
     $this->clearTestingCache();
     parent::tearDown();
 }
Ejemplo n.º 26
0
 /**
  * トランザクションをロールバックする.
  */
 public function tearDown()
 {
     parent::tearDown();
     $this->app['orm.em']->getConnection()->rollback();
 }
Ejemplo n.º 27
0
 public function setUp()
 {
     parent::setUp();
     $this->loadFixtures();
 }
Ejemplo n.º 28
0
 public function setUp()
 {
     parent::setUp();
     $this->app['db']->beginTransaction();
     $this->app['db']->setRollbackOnly();
 }
 /**
  * PHPUnit setUp.
  */
 public function setUp()
 {
     parent::setUp();
     $this->client = $this->createClient();
 }
Ejemplo n.º 30
0
 public function setUp()
 {
     $this->testEnvironment = TestEnvironment::newInstance();
     $this->apiFactory = $this->testEnvironment->getFactory();
     parent::setUp();
 }