Exemplo n.º 1
0
 /**
  * @test
  * @expectedException \AppZap\PHPFramework\Mvc\ApplicationPartMissingException
  * @expectedExceptionCode 1410537933
  */
 public function cacheFolderNotWritable()
 {
     Configuration::reset();
     Configuration::set('phpframework', 'cache.enable', TRUE);
     Configuration::set('phpframework', 'cache.folder', '/');
     $cache = CacheFactory::getCache();
     $this->assertTrue($cache->getStorage() instanceof FileStorage);
 }
 public function setUp()
 {
     Configuration::reset();
     $database = 'phpunit_tests';
     $host = '127.0.0.1';
     $password = '';
     $user = '******';
     Configuration::set('phpframework', 'db.mysql.database', $database);
     Configuration::set('phpframework', 'db.mysql.host', $host);
     Configuration::set('phpframework', 'db.mysql.password', $password);
     Configuration::set('phpframework', 'db.mysql.user', $user);
     $this->pdo = new \PDO('mysql:host=' . $host . ';dbname=' . $database . ';port=3306', $user, $password);
     StaticDatabaseConnection::reset();
     $this->fixture = StaticDatabaseConnection::getInstance();
 }
Exemplo n.º 3
0
 public function setUp()
 {
     Configuration::reset();
     $database = 'phpunit_tests';
     $host = '127.0.0.1';
     $password = '';
     $user = '******';
     Configuration::set('phpframework', 'db.mysql.database', $database);
     Configuration::set('phpframework', 'db.mysql.host', $host);
     Configuration::set('phpframework', 'db.mysql.password', $password);
     Configuration::set('phpframework', 'db.mysql.user', $user);
     $this->basePath = dirname(__FILE__);
     $this->db = StaticDatabaseConnection::getInstance();
     $this->db->query('DROP TABLE IF EXISTS `migration_ver`');
     $this->db->query('DROP TABLE IF EXISTS `migrator_test_1`');
     $this->db->query('DROP TABLE IF EXISTS `migrator_test_2`');
     $this->db->query('DROP TABLE IF EXISTS `migrator_test_error`');
     $this->db->query('DROP TABLE IF EXISTS `migrator_test_timestamps`');
 }
Exemplo n.º 4
0
 /**
  * @param string $application
  * @throws \Exception
  */
 protected static function initializeConfiguration($application)
 {
     Configuration::reset();
     DefaultConfiguration::initialize($application);
     IniParser::initialize();
 }
 public function setUp()
 {
     $_ENV['AppZap\\PHPFramework\\ProjectRoot'] = __DIR__;
     Configuration::reset();
 }
Exemplo n.º 6
0
 public function setUp()
 {
     Configuration::reset();
 }
Exemplo n.º 7
0
 /**
  * @test
  */
 public function getSectionDefaultValuesNamespace()
 {
     Configuration::reset();
     Configuration::set('test', 'ns1.key1', 1);
     Configuration::set('test', 'ns2.key2', FALSE);
     Configuration::set('test', 'ns1.key3', 3);
     $configuration = Configuration::getSection('test', 'ns1', ['key1' => FALSE, 'key2' => 2]);
     $this->assertSame(1, $configuration['key1']);
     $this->assertSame(2, $configuration['key2']);
     $this->assertSame(3, $configuration['key3']);
 }