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);
     }
 }
Exemplo n.º 2
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $evm->addEventSubscriber(new SluggableListener());
     $this->getMockSqliteEntityManager($evm);
 }
Exemplo n.º 3
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $this->encoderListener = new EncoderListener();
     $evm->addEventSubscriber($this->encoderListener);
     $this->getMockSqliteEntityManager($evm);
 }
 public function setUp()
 {
     parent::setUp();
     $this->timestampable = new TimestampableListener();
     $evm = new EventManager();
     $evm->addEventSubscriber($this->timestampable);
     $this->getMockSqliteEntityManager($evm);
 }
 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);
 }
Exemplo n.º 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);
 }
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $this->translatableListener = new TranslationListener();
     $this->translatableListener->setTranslatableLocale('en_us');
     $evm->addEventSubscriber($this->translatableListener);
     $this->getMockSqliteEntityManager($evm);
 }
 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');
 }
    protected function setUp()
    {
        parent::setUp();

        $evm = new EventManager;
        $this->HistoryableListener = new HistoryableListener();
        $evm->addEventSubscriber($this->HistoryableListener);
        $this->em = $this->getMockSqliteEntityManager($evm);
    }
Exemplo n.º 10
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $ipTraceableListener = new IpTraceableListener();
     $ipTraceableListener->setIpValue(self::TEST_IP);
     $evm->addEventSubscriber($ipTraceableListener);
     $this->getMockSqliteEntityManager($evm);
 }
Exemplo n.º 11
0
 protected function setUp()
 {
     parent::setUp();
     $this->listener = new TreeListener();
     $evm = new EventManager();
     $evm->addEventSubscriber($this->listener);
     $this->getMockSqliteEntityManager($evm);
     $this->populate();
 }
 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);
 }
Exemplo n.º 13
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $blameableListener = new BlameableListener();
     $blameableListener->setUserValue('testuser');
     $evm->addEventSubscriber($blameableListener);
     $this->getMockSqliteEntityManager($evm);
 }
Exemplo n.º 14
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $evm->addEventSubscriber(new SortableListener());
     $this->getMockSqliteEntityManager($evm);
     //$this->startQueryLog();
     $this->populate();
 }
 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);
 }
Exemplo n.º 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);
 }
 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);
 }
 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
 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();
 }
 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);*/
 }
 protected function setUp()
 {
     parent::setUp();
     $this->getMockSqliteEntityManager();
     $this->populate();
 }
 protected function setUp()
 {
     parent::setUp();
 }
Exemplo n.º 25
0
 protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $this->getMockSqliteEntityManager($evm);
 }