Inheritance: extends PHPUnit_Framework_TestCas\PHPUnit_Framework_TestCase
コード例 #1
0
 public function setUp()
 {
     parent::setUp();
     $this->locationGateway = $this->getMock('eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway');
     $this->locationMapper = $this->getMock('eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Mapper');
     $this->treeHandler = $this->getMock('eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\TreeHandler', array(), array(), '', false);
 }
コード例 #2
0
 /**
  * Reset DB sequences.
  */
 public function resetSequences()
 {
     parent::resetSequences();
     switch ($this->db) {
         case 'pgsql':
             // Update PostgreSQL sequences
             $handler = $this->getDatabaseHandler();
             $queries = array_filter(preg_split('(;\\s*$)m', file_get_contents(__DIR__ . '/../../../../../schema/_fixtures/setval.pgsql.sql')));
             foreach ($queries as $query) {
                 $handler->exec($query);
             }
             break;
     }
 }
コード例 #3
0
 /**
  * Only set up once for these read only tests on a large fixture
  *
  * Skipping the reset-up, since setting up for these tests takes quite some
  * time, which is not required to spent, since we are only reading from the
  * database anyways.
  *
  * @return void
  */
 public function setUp()
 {
     if ( !self::$setUp )
     {
         self::$container = $this->getContainer();
         $this->handler = self::$container->get( "ezpublish.api.storage_engine.legacy.dbhandler" );
         $this->db = $this->handler->getName();
         parent::setUp();
         $this->insertDatabaseFixture( __DIR__ . '/../../../Core/Repository/Tests/Service/Integration/Legacy/_fixtures/clean_ezdemo_47_dump.php' );
         self::$setUp = $this->handler;
     }
     else
     {
         $this->handler = self::$setUp;
     }
 }
コード例 #4
0
 /**
  * Inserts DB fixture.
  */
 public function setUp()
 {
     parent::setUp();
     $this->insertDatabaseFixture(__DIR__ . '/../../_fixtures/roles.php');
 }