コード例 #1
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $this->listener = new UploadableListenerStub();
     $this->listener->setMimeTypeGuesser(new MimeTypeGuesserStub('text/plain'));
     $evm->addEventSubscriber($this->listener);
     $config = $this->getMockAnnotatedConfig();
     $this->em = $this->getMockSqliteEntityManager($evm, $config);
     $this->testFile = __DIR__ . '/../../data/test.txt';
     $this->testFile2 = __DIR__ . '/../../data/test2.txt';
     $this->testFile3 = __DIR__ . '/../../data/test_3.txt';
     $this->testFileWithoutExt = __DIR__ . '/../../data/test4';
     $this->testFileWithSpaces = __DIR__ . '/../../data/test with spaces.txt';
     $this->destinationTestDir = __DIR__ . '/../../temp/uploadable';
     $this->destinationTestFile = $this->destinationTestDir . '/test.txt';
     $this->destinationTestFile2 = $this->destinationTestDir . '/test2.txt';
     $this->destinationTestFile3 = $this->destinationTestDir . '/test_3.txt';
     $this->destinationTestFileWithoutExt = $this->destinationTestDir . '/test4';
     $this->destinationTestFileWithSpaces = $this->destinationTestDir . '/test with spaces';
     $this->testFilename = substr($this->testFile, strrpos($this->testFile, '/') + 1);
     $this->testFilename2 = substr($this->testFile2, strrpos($this->testFile2, '/') + 1);
     $this->testFilename3 = substr($this->testFile3, strrpos($this->testFile3, '/') + 1);
     $this->testFilenameWithoutExt = substr($this->testFileWithoutExt, strrpos($this->testFileWithoutExt, '/') + 1);
     $this->testFilenameWithSpaces = substr($this->testFileWithSpaces, strrpos($this->testFileWithSpaces, '/') + 1);
     $this->testFileSize = 4;
     $this->testFileMimeType = 'text/plain';
     $this->clearFilesAndDirectories();
     if (!is_dir($this->destinationTestDir)) {
         mkdir($this->destinationTestDir);
     }
 }
コード例 #2
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $evm->addEventSubscriber(new SluggableListener());
     $this->getMockSqliteEntityManager($evm);
 }
コード例 #3
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $this->encoderListener = new EncoderListener();
     $evm->addEventSubscriber($this->encoderListener);
     $this->getMockSqliteEntityManager($evm);
 }
コード例 #4
0
 public function setUp()
 {
     parent::setUp();
     $this->timestampable = new TimestampableListener();
     $evm = new EventManager();
     $evm->addEventSubscriber($this->timestampable);
     $this->getMockSqliteEntityManager($evm);
 }
コード例 #5
0
 protected function setUp()
 {
     parent::setUp();
     require_once __DIR__ . '/Mock/Extension/Encoder/Mapping/Annotations.php';
     $evm = new EventManager();
     $this->encoderListener = new EncoderListener();
     $evm->addEventSubscriber($this->encoderListener);
     $this->getMockSqliteEntityManager($evm);
 }
コード例 #6
0
 protected function setUp()
 {
     parent::setUp();
     $this->listener = new TimestampableListenerStub();
     $this->listener->eventAdapter = new EventAdapterORMStub();
     $evm = new EventManager();
     $evm->addEventSubscriber($this->listener);
     $this->getMockSqliteEntityManager($evm);
 }
コード例 #7
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $this->translatableListener = new TranslationListener();
     $this->translatableListener->setTranslatableLocale('en_us');
     $evm->addEventSubscriber($this->translatableListener);
     $this->getMockSqliteEntityManager($evm);
 }
コード例 #8
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $evm->addEventSubscriber($this->softDeleteableListener = new SoftDeleteableListener());
     $this->getMockSqliteEntityManager($evm);
     $this->em->getConfiguration()->addFilter('softdelete', 'Gedmo\\SoftDeleteable\\Filter\\SoftDeleteableFilter');
     $this->em->getFilters()->enable('softdelete');
 }
コード例 #9
0
    protected function setUp()
    {
        parent::setUp();

        $evm = new EventManager;
        $this->HistoryableListener = new HistoryableListener();
        $evm->addEventSubscriber($this->HistoryableListener);
        $this->em = $this->getMockSqliteEntityManager($evm);
    }
コード例 #10
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $ipTraceableListener = new IpTraceableListener();
     $ipTraceableListener->setIpValue(self::TEST_IP);
     $evm->addEventSubscriber($ipTraceableListener);
     $this->getMockSqliteEntityManager($evm);
 }
コード例 #11
0
 protected function setUp()
 {
     parent::setUp();
     $this->listener = new TreeListener();
     $evm = new EventManager();
     $evm->addEventSubscriber($this->listener);
     $this->getMockSqliteEntityManager($evm);
     $this->populate();
 }
コード例 #12
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $this->LoggableListener = new LoggableListener();
     $this->LoggableListener->setUsername('jules');
     $evm->addEventSubscriber($this->LoggableListener);
     $this->em = $this->getMockSqliteEntityManager($evm);
 }
コード例 #13
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $blameableListener = new BlameableListener();
     $blameableListener->setUserValue('testuser');
     $evm->addEventSubscriber($blameableListener);
     $this->getMockSqliteEntityManager($evm);
 }
コード例 #14
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $evm->addEventSubscriber(new SortableListener());
     $this->getMockSqliteEntityManager($evm);
     //$this->startQueryLog();
     $this->populate();
 }
コード例 #15
0
 protected function setUp()
 {
     parent::setUp();
     $this->listener = new TreeListener();
     $evm = new EventManager();
     $evm->addEventSubscriber($this->listener);
     $this->getMockSqliteEntityManager($evm);
     $meta = $this->em->getClassMetadata(self::CATEGORY);
     $this->config = $this->listener->getConfiguration($this->em, $meta->name);
 }
コード例 #16
0
 protected function setUp()
 {
     parent::setUp();
     if (version_compare(PHP_VERSION, '5.4.0') < 0) {
         $this->markTestSkipped('PHP >= 5.4 version required for this test.');
     }
     $evm = new EventManager();
     $evm->addEventSubscriber(new TimestampableListener());
     $this->getMockSqliteEntityManager($evm);
 }
コード例 #17
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $this->softDeleteableListener = new SoftDeleteableListener();
     $evm->addEventSubscriber($this->softDeleteableListener);
     $config = $this->getMockAnnotatedConfig();
     $config->addFilter(self::SOFT_DELETEABLE_FILTER_NAME, 'Gedmo\\SoftDeleteable\\Filter\\SoftDeleteableFilter');
     $this->em = $this->getMockSqliteEntityManager($evm, $config);
     $this->em->getFilters()->enable(self::SOFT_DELETEABLE_FILTER_NAME);
 }
コード例 #18
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $this->translatableListener = new TranslatableListener();
     $this->translatableListener->setTranslatableLocale('en');
     $this->translatableListener->setDefaultLocale('en');
     $evm->addEventSubscriber($this->translatableListener);
     $conn = array('driver' => 'pdo_mysql', 'host' => '127.0.0.1', 'dbname' => 'test', 'user' => 'root', 'password' => 'nimda');
     //$this->getMockCustomEntityManager($conn, $evm);
     $this->getMockSqliteEntityManager($evm);
 }
コード例 #19
0
 protected function setUp()
 {
     parent::setUp();
     if (version_compare(PHP_VERSION, '5.4.0') < 0) {
         $this->markTestSkipped('PHP >= 5.4 version required for this test.');
     }
     $listener = new BlameableListener();
     $listener->setUserValue('testuser');
     $evm = new EventManager();
     $evm->addEventSubscriber($listener);
     $this->getMockSqliteEntityManager($evm);
 }
コード例 #20
0
 protected function setUp()
 {
     parent::setUp();
     if (version_compare(PHP_VERSION, '5.4.0') < 0) {
         $this->markTestSkipped('PHP >= 5.4 version required for this test.');
     }
     $evm = new EventManager();
     $ipTraceableListener = new IpTraceableListener();
     $ipTraceableListener->setIpValue(self::TEST_IP);
     $evm->addEventSubscriber($ipTraceableListener);
     $this->getMockSqliteEntityManager($evm);
 }
コード例 #21
0
 protected function setUp()
 {
     parent::setUp();
     if (!Type::hasType('custom')) {
         Type::addType('custom', 'Translatable\\Fixture\\Type\\Custom');
     }
     $evm = new EventManager();
     $this->translatableListener = new TranslationListener();
     $this->translatableListener->setTranslatableLocale('en_us');
     $evm->addEventSubscriber($this->translatableListener);
     $this->getMockSqliteEntityManager($evm);
     $this->populate();
 }
コード例 #22
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $evm->addEventSubscriber(new SortableListener());
     $this->getMockSqliteEntityManager($evm);
     /*$this->getMockCustomEntityManager(array(
           'driver' => 'pdo_mysql',
           'dbname' => 'test',
           'host' => '127.0.0.1',
           'user' => 'root',
           'password' => 'nimda'
       ), $evm);*/
 }
コード例 #23
0
 protected function setUp()
 {
     parent::setUp();
     $this->getMockSqliteEntityManager();
     $this->populate();
 }
コード例 #24
0
 protected function setUp()
 {
     parent::setUp();
 }
コード例 #25
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $this->getMockSqliteEntityManager($evm);
 }