コード例 #1
0
ファイル: ResultTest.php プロジェクト: localgod/php-tick
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     Manager::addDefaultConnectionConfig('sqlite', ':memory:', null, null, '127.0.0.1', null, array(PDO::ATTR_PERSISTENT => true));
     Manager::setModelPath(dirname(__FILE__) . '/_testdata/');
     $storage = Manager::getStorage();
     $storage->getConnection()->exec(file_get_contents(dirname(__FILE__) . '/_testdata/schema.sql'));
     $storage->getConnection()->exec(file_get_contents(dirname(__FILE__) . '/_testdata/fixture.sql'));
 }
コード例 #2
0
ファイル: MongoTest.php プロジェクト: localgod/php-tick
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     if (extension_loaded('mongo')) {
         if (shell_exec('mongod --version | grep "db version"') == '') {
             $this->markTestSkipped('The mongod execuatable is not available.');
         }
     }
     if (!extension_loaded('mongo')) {
         $this->markTestSkipped('The mongo extension is not available.');
     }
     Manager::addDefaultConnectionConfig('mongodb', 'mongotest', null, null, '127.0.0.1', 27088);
     Manager::setModelPath(dirname(__FILE__) . '/_testdata/');
     shell_exec('mongoimport --port 27088 --drop --db mongotest --collection users --file ' . dirname(__FILE__) . '/_testdata/fixture.json');
     sleep(1);
 }
コード例 #3
0
ファイル: ManagerTest.php プロジェクト: localgod/php-tick
 /**
  * Test
  *
  * @tests
  *
  * @return void
  */
 public function setAndGetExistingModelPathFails()
 {
     Manager::setModelPath("./");
     $this->assertEquals("./", Manager::getModelPath("./"));
 }
コード例 #4
0
ファイル: EntityTest.php プロジェクト: localgod/php-tick
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     Manager::setModelPath(dirname(__FILE__) . '/_testdata/');
     $this->expected = array("properties" => array("id" => array("field" => "user_id", "type" => "integer", 'default' => null, "size" => 11, "unique" => true), "name" => array("field" => "full_name", "type" => "string", "size" => 255, "null" => true, "default" => "Jane"), "username" => array("field" => "email", "type" => "string", "size" => 128, "default" => "Doe Doe"), "created" => array("field" => "created", "type" => "DateTime", 'default' => null), "updated" => array("field" => "updated", "type" => "DateTime", 'default' => null, "null" => true)), "fields" => array("user_id" => array('property' => 'id', "field" => "user_id", "type" => "integer", "size" => 11, "unique" => true, 'default' => null), "full_name" => array('property' => 'name', "field" => "full_name", "type" => "string", "size" => 255, "null" => true, "default" => "Jane"), "email" => array('property' => 'username', "field" => "email", "type" => "string", "size" => 128, "default" => "Doe Doe"), "created" => array('property' => 'created', "field" => "created", "type" => "DateTime", 'default' => null), "updated" => array('property' => 'updated', "field" => "updated", "type" => "DateTime", "null" => true, 'default' => null)));
 }
コード例 #5
0
ファイル: RecordTest.php プロジェクト: localgod/php-tick
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     Manager::setModelPath(dirname(__FILE__) . '/_testdata/');
 }