Пример #1
1
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     $this->_className = $name;
     $this->_root = dirname(__FILE__);
     date_default_timezone_set('UTC');
     parent::__construct($name, $data, $dataName);
 }
Пример #2
0
 public function __construct()
 {
     parent::__construct();
     require_once __DIR__ . '/../../htdocs/vendor/autoload.php';
     $this->dir = __DIR__;
     $this->baseUrl = 'http://local.opencaching.de';
 }
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     $this->memcached = new \Memcached();
     $this->memcached->addServer('localhost', 11211);
     $this->handler = new MemcachedHandler('MHT_');
 }
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     $this->pdo = new PDO('sqlite::memory:');
     BankAccount::createTable($this->pdo);
     $this->tester = $this->getDatabaseTester();
 }
Пример #5
0
    /**
     * Constructs a test case with the given name.
     *
     * Note: use setUp() or setUpBeforeClass() in your test cases.
     *
     * @param string $name
     * @param array  $data
     * @param string $dataName
     */
    final public function __construct($name = null, array $data = array(), $dataName = '') {
        parent::__construct($name, $data, $dataName);

        $this->setBackupGlobals(false);
        $this->setBackupStaticAttributes(false);
        $this->setRunTestInSeparateProcess(false);
    }
Пример #6
0
 public function __construct()
 {
     parent::__construct();
     $this->token = $this->loadToken();
     $this->memcacheHost = getenv('MEMCACHE_HOST') ? getenv('MEMCACHE_HOST') : null;
     $this->memcachePort = getenv('MEMCACHE_PORT') ? getenv('MEMCACHE_PORT') : null;
 }
 /**
  * {@InheritDoc}
  */
 public function setUp()
 {
     parent::__construct();
     $baseUrlMock = 'http://mock.ette/api/';
     $this->guzzle = $this->getMockForAbstractClass('CanalTP\\FenrirApiClient\\AbstractGuzzle\\Guzzle', [$baseUrlMock]);
     $this->fenrirApi = new FenrirApi($this->guzzle);
 }
Пример #8
0
 public function __construct($name = NULL, array $data = array(), $dataName = '')
 {
     //$this->setPreserveGlobalState(false);
     //$this->setBackupGlobals(false);
     self::_initPathVar();
     parent::__construct($name, $data, $dataName);
 }
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     if (!is_dir($this->tokenDirPath)) {
         mkdir($this->tokenDirPath);
     }
 }
Пример #10
0
 public function __construct()
 {
     global $BOS_TEST_CONFIG;
     parent::__construct();
     $this->client = new BosClient($BOS_TEST_CONFIG);
     $this->logger = LogFactory::getLogger(get_class($this));
 }
 /**
  * 
  * Creates a new Kaltura test Object
  * @param string $name
  * @param array $data
  * @param string $dataName
  */
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     $class = get_class($this);
     if ($name) {
         KalturaLog::info("_____________________________________ [{$class}] [{$name}] ___________________________________");
     } else {
         KalturaLog::info("__________________________________________ [{$class}] ______________________________________");
     }
     $testFilePath = KAutoloader::getClassFilePath($class);
     $this->testFolder = dirname($testFilePath);
     $this->inputs = $data;
     KalturaLog::info("Loads config file [{$testFilePath}.ini]");
     $this->config = new KalturaTestConfig("{$testFilePath}.ini");
     $testConfig = $this->config->get('config');
     if (!$testConfig) {
         $testConfig = new Zend_Config(array('source' => KalturaTestSource::XML), true);
         $this->config->config = $testConfig;
         $this->config->saveToIniFile();
     }
     $this->dataSource = $testConfig->source;
     $this->outputFolder = $testConfig->outputFolder;
     if ($this->outputFolder && !is_dir($this->outputFolder)) {
         KalturaLog::info("Creating folder output [{$this->outputFolder}]");
         mkdir($this->outputFolder, 777, true);
     }
 }
Пример #12
0
 public function __construct($name = NULL, array $data = array(), $dataName = '')
 {
     $this->app = MapasCulturais\App::i();
     $this->backupGlobals = false;
     $this->backupStaticAttributes = false;
     parent::__construct($name, $data, $dataName);
 }
Пример #13
0
 public function __construct()
 {
     parent::__construct();
     $this->file = dirname(__FILE__) . "/assets/name_color.pdf";
     $this->complex_file = dirname(__FILE__) . "/assets/complex.pdf";
     $this->fields = array('name' => 'John Smith', 'color' => 'Blue');
 }
Пример #14
0
 public function __construct()
 {
     parent::__construct();
     $this->order = new Routify\Order('/', Routify\Method::GET, function () {
         return 'ok, this works';
     });
 }
Пример #15
0
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     if ($this->metaDataClassNames !== null) {
         $this->setupEntityManager();
     }
 }
Пример #16
0
 /**
  * Constructs a test case with the given name.
  * @since 1.0
  *
  * @param string $name
  * @param array  $data
  * @param string $dataName
  */
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     $this->builder = new AyucoBuilder();
     $this->env['plugin']['path'] = ENV_PATH . $this->env['plugin']['path'];
     $this->env['theme']['path'] = ENV_PATH . $this->env['theme']['path'];
 }
Пример #17
0
 public function __construct()
 {
     parent::__construct();
     /** @var Pdo $storage */
     $this->storage = $storage = StorageManager::instance('mysql', 'localhost', 5432, 'app', 'root', 'root');
     $storage->exec('DROP TABLE IF EXISTS People');
     $storage->exec('DROP TABLE IF EXISTS ClassRoom');
     $storage->exec('
         CREATE TABLE People(
             id CHAR(13) PRIMARY KEY,
             studentName VARCHAR(150) NOT NULL,
             age INT(10) NOT NULL
         );
     ');
     $storage->exec('
         CREATE TABLE ClassRoom(
             id CHAR(13) PRIMARY KEY,
             lesson VARCHAR(150) NOT NULL,
             peopleId CHAR(13) NOT NULL
         );
     ');
     $this->people = new People('55d40f0064dcd', 'Ibal', 10);
     $this->storage->save($this->people, 'People');
     $this->people = new People('55d40f0064dcc', 'Iqbal', 25);
     $this->storage->save($this->people, 'People');
 }
Пример #18
0
 public function __construct()
 {
     $kernel = new \AppKernel("test", true);
     $kernel->boot();
     $this->container = $kernel->getContainer();
     parent::__construct();
 }
 /**
  * Constructs a test case with the given name.
  *
  * @param string $name
  * @param array $data
  * @param string $dataName
  */
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     $this->addressEntityClass = get_class($this->createAddressEntity());
     $this->billingType = new AddressType(AddressType::TYPE_BILLING);
     $this->shippingType = new AddressType(AddressType::TYPE_SHIPPING);
     parent::__construct($name, $data, $dataName);
 }
Пример #20
0
 public function __construct()
 {
     parent::__construct();
     $this->bus = $bus = new QueryBus();
     $bus->register('Borobudur\\Cqrs\\Test\\AllMovieQuery', 'Borobudur\\Cqrs\\Test\\AllMovieQueryHandler');
     $bus->register('Borobudur\\Cqrs\\Test\\DetailMovieQuery', 'Borobudur\\Cqrs\\Test\\DetailMovieQueryHandler');
     /** @var Pdo $storage */
     $this->storage = $storage = StorageManager::instance('mysql', 'localhost', 5432, 'app', 'root');
     self::$repository = new MovieRepository($this->storage);
     $storage->exec('DROP TABLE IF EXISTS Movie');
     $storage->exec('
         CREATE TABLE Movie(
             id CHAR(13) PRIMARY KEY,
             name VARCHAR(100) NOT NULL,
             schedule DATETIME NOT NULL,
             price INT NULL,
             buyers INT NULL,
             deleted INT(1) NOT NULL
         );
     ');
     $data = array(array('name' => 'San Andreas', 'schedule' => new \DateTime(), 'price' => 25000, 'buyers' => 5), array('name' => 'Godzila', 'schedule' => new \DateTime(), 'price' => 30000, 'buyers' => 1), array('name' => 'Social Network', 'schedule' => new \DateTime('+1 month'), 'price' => 50000, 'buyers' => 6), array('name' => 'Pixed', 'schedule' => new \DateTime('+1 day'), 'price' => 100000, 'buyers' => 10), array('name' => 'Ace ventura', 'schedule' => new \DateTime('-1 month'), 'price' => 80000, 'buyers' => 3));
     foreach ($data as $record) {
         self::$repository->save(new MovieReadModel(uniqid(), $record['name'], $record['schedule']->format('Y-m-d H:i:s'), $record['price'], $record['buyers']));
     }
 }
Пример #21
0
 public function __construct($name = NULL, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     if ($this->useVerboseErrorHandler) {
         $this->setVerboseErrorHandler();
     }
 }
Пример #22
0
 public function __construct($name = null, array $data = [], $dataName = "")
 {
     /** @var Injector $injector */
     $injector = getTestInjector();
     $this->injector = $injector;
     parent::__construct($name, $data, $dataName);
 }
Пример #23
0
 function __construct($name = null, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     $Base = new \SC\SC();
     $Base->connect('mysql', 'localhost', 'test', 'root');
     $this->Base = $Base;
 }
Пример #24
0
 public function __construct($config = null)
 {
     parent::__construct($config);
     // convert from Solar_Role_Adapter_WhateverTest
     // to Solar_Role_Adapter_Whatever
     $this->_class = substr(get_class($this), 0, -4);
 }
Пример #25
0
 public function __construct($name = NULL, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     if (file_exists('/tmp/sample_data.ser')) {
         @unlink('/tmp/sample_data.ser');
     }
 }
Пример #26
0
 public function __construct()
 {
     parent::__construct();
     $this->testArr = ['this_is_a_drupal_naming_convention' => 'whatever', 'node_form_type_edit' => 0, 'entity_something' => new \stdClass(), 'ends_with_entity' => 1, 'in_the_entity_middle' => 2, 'another_ends_in_entity' => 2];
     $this->testArr2 = ['this&is&a&drupal&naming&convention' => 'whatever', 'node&form&type&edit' => 0, 'entity&something' => new \stdClass(), 'nokeyhere' => NULL];
     $this->testArr3 = ['class' => new Arr(), 'another' => new Rand(), 'more' => new Arr()];
 }
Пример #27
0
 public function __construct($name = null, $data = array(), $dataName = '')
 {
     $this->lexer = new Lexer();
     $this->css_parser = new Parser($this->lexer);
     $this->fixtures_dir = __DIR__ . '/../../files';
     parent::__construct($name, $data, $dataName);
 }
Пример #28
0
 public function __construct()
 {
     $this->array1D = new DotArray($this->oneDArray);
     $this->array2D = new DotArray($this->twoDArray);
     $this->array3D = new DotArray($this->threeDArray);
     parent::__construct();
 }
Пример #29
0
 public function __construct()
 {
     parent::__construct();
     $pdo = new PDO('sqlite::memory:');
     $artists = [['name' => 'The Smashing Pumpkins', 'albums' => [['name' => 'Siamese Dream', 'year' => 1993, 'songs' => ['Hummer', 'Disarm', 'Soma', 'Mayonaise']], ['name' => 'Pisces Iscariot', 'year' => 1994, 'songs' => ['Plume', 'Whir', 'Landslide']]]], ['name' => 'Placebo', 'albums' => [['name' => 'Without You I\'m Nothing', 'year' => 1998, 'songs' => ['Pure Morning', 'Brick Shithouse', 'You Don\'t Care About Us', 'Allergic (to Thoughts of Mother Earth)', 'Every You Every Me']], ['name' => 'Black Market Music', 'year' => 2000, 'songs' => ['Taste in Men', 'Special K', 'Spice & Malice', 'Black-Eyed', 'Peeping Tom']], ['name' => 'Sleeping With Ghosts', 'year' => 2002, 'songs' => ['English Summer Rain', 'This Picture', 'Special Needs', 'Second Sight', 'Centrefolds']]]], ['name' => 'The Who', 'albums' => [['name' => 'Who\'s Next', 'year' => 1971, 'songs' => ['Baba O\'Riley', 'My Wife', 'Going Mobile', 'Behind Blue Eyes']]]]];
     $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
     $pdo->exec("CREATE TABLE artists (id INTEGER PRIMARY KEY, name TEXT)");
     $pdo->exec("CREATE TABLE albums  (id INTEGER PRIMARY KEY, name TEXT, year INTEGER, artist_id INTEGER)");
     $pdo->exec("CREATE TABLE songs   (id INTEGER PRIMARY KEY, name TEXT, track_number INTEGER, album_id INTEGER)");
     $insert_artist = $pdo->prepare("INSERT INTO artists (name) VALUES (?)");
     $insert_album = $pdo->prepare("INSERT INTO albums (name, year, artist_id) VALUES (?, ?, ?)");
     $insert_song = $pdo->prepare("INSERT INTO songs (name, track_number, album_id) VALUES (?, ?, ?)");
     $pdo->beginTransaction();
     foreach ($artists as $artist) {
         $insert_artist->execute([$artist['name']]);
         $artist_id = $pdo->lastInsertId();
         foreach ($artist['albums'] as $album) {
             $insert_album->execute([$album['name'], $album['year'], $artist_id]);
             $album_id = $pdo->lastInsertId();
             foreach ($album['songs'] as $track_number => $song) {
                 $insert_song->execute([$song, $track_number + 1, $album_id]);
             }
         }
     }
     $this->pdo = $pdo;
 }
Пример #30
0
 public function __construct($name)
 {
     parent::__construct($name);
     $argc = 1;
     $argv = array("argv");
     $this->app = new QApplication($argc, $argv);
 }