コード例 #1
0
 public function testTestmode()
 {
     $local = './localsettings.json';
     @unlink($local);
     Initbootstrap::init();
     $localSettings = new Settings('local');
     $localSettings->wppath_test = 'foobar';
     file_put_contents($local, $localSettings->toString());
     define('TESTMODE', true);
     $localSettings = new Settings('local');
     //print_r($localSettings);
     $this->assertEquals('foobar', $localSettings->wppath);
 }
コード例 #2
0
 public function testInit()
 {
     require_once __DIR__ . '/../vendor/autoload.php';
     // ensure no previous files exists
     $local = './localsettings.json';
     $app = './appsettings.json';
     @unlink($local);
     @unlink($app);
     $this->assertFalse(file_exists($local));
     $this->assertFalse(file_exists($app));
     Initbootstrap::init();
     $this->assertTrue(file_exists($local));
     $this->assertTrue(file_exists($app));
     $this->assertJson(file_get_contents($local));
     $this->assertJson(file_get_contents($app));
     @unlink($local);
     @unlink($app);
 }