php Tool-BaseTestCaseORM类(方法)实例源码

下面列出了php Tool-BaseTestCaseORM 类(方法)源码代码实例,从而了解它的用法。

作者:erichar    项目:DoctrineExtension   
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);
     }
 }

作者:esser    项目:DoctrineExtension   
protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $evm->addEventSubscriber(new SluggableListener());
     $this->getMockSqliteEntityManager($evm);
 }

作者:robertowes    项目:CuteFlow-V   
protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $this->encoderListener = new EncoderListener();
     $evm->addEventSubscriber($this->encoderListener);
     $this->getMockSqliteEntityManager($evm);
 }

作者:erichar    项目:DoctrineExtension   
public function setUp()
 {
     parent::setUp();
     $this->timestampable = new TimestampableListener();
     $evm = new EventManager();
     $evm->addEventSubscriber($this->timestampable);
     $this->getMockSqliteEntityManager($evm);
 }

作者:ilosad    项目:chamilo-lms-icpn   
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);
 }

作者:erichar    项目:DoctrineExtension   
protected function setUp()
 {
     parent::setUp();
     $this->listener = new TimestampableListenerStub();
     $this->listener->eventAdapter = new EventAdapterORMStub();
     $evm = new EventManager();
     $evm->addEventSubscriber($this->listener);
     $this->getMockSqliteEntityManager($evm);
 }

作者:rdohm    项目:DoctrineExtension   
protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $this->translatableListener = new TranslationListener();
     $this->translatableListener->setTranslatableLocale('en_us');
     $evm->addEventSubscriber($this->translatableListener);
     $this->getMockSqliteEntityManager($evm);
 }

作者:ilosad    项目:chamilo-lms-icpn   
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');
 }

作者:nacmarti    项目:Historyabl   
protected function setUp()
    {
        parent::setUp();

        $evm = new EventManager;
        $this->HistoryableListener = new HistoryableListener();
        $evm->addEventSubscriber($this->HistoryableListener);
        $this->em = $this->getMockSqliteEntityManager($evm);
    }

作者:esser    项目:DoctrineExtension   
protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $ipTraceableListener = new IpTraceableListener();
     $ipTraceableListener->setIpValue(self::TEST_IP);
     $evm->addEventSubscriber($ipTraceableListener);
     $this->getMockSqliteEntityManager($evm);
 }

作者:esser    项目:DoctrineExtension   
protected function setUp()
 {
     parent::setUp();
     $this->listener = new TreeListener();
     $evm = new EventManager();
     $evm->addEventSubscriber($this->listener);
     $this->getMockSqliteEntityManager($evm);
     $this->populate();
 }

作者:esser    项目:DoctrineExtension   
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);
 }

作者:erichar    项目:DoctrineExtension   
protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $blameableListener = new BlameableListener();
     $blameableListener->setUserValue('testuser');
     $evm->addEventSubscriber($blameableListener);
     $this->getMockSqliteEntityManager($evm);
 }

作者:recip    项目:DoctrineExtension   
protected function setUp()
 {
     parent::setUp();
     $evm = new EventManager();
     $evm->addEventSubscriber(new SortableListener());
     $this->getMockSqliteEntityManager($evm);
     //$this->startQueryLog();
     $this->populate();
 }

作者:esser    项目:DoctrineExtension   
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);
 }

作者:esser    项目:DoctrineExtension   
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);
 }

作者:ilosad    项目:chamilo-lms-icpn   
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);
 }

作者:n1c01a    项目:DoctrineExtension   
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);
 }

作者:erichar    项目:DoctrineExtension   
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);
 }

作者:rdohm    项目:DoctrineExtension   
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();
 }


问题


面经


文章

微信
公众号

扫码关注公众号