예제 #1
0
 public function testGetSlimInstance()
 {
     $expectedConfig = array('version' => '0.0.0', 'debug' => false, 'mode' => 'testing');
     $testCase = new WebTestCase();
     $slim = $testCase->getSlimInstance();
     $this->assertInstanceOf('\\Slim\\Slim', $slim);
     foreach ($expectedConfig as $key => $value) {
         $this->assertSame($expectedConfig[$key], $slim->config($key));
     }
 }
예제 #2
0
 public function testGetSlimInstance()
 {
     $expectedConfig = array('version' => '0.0.0', 'debug' => false, 'mode' => 'testing');
     $testCase = new WebTestCase();
     $slim = $testCase->getSlimInstance();
     self::assertInstanceOf('\\Slim\\App', $slim);
     foreach ($expectedConfig as $key => $value) {
         self::assertSame($expectedConfig[$key], $slim->getContainer()->get('settings')[$key]);
     }
 }
예제 #3
0
 private function getSlimInstance()
 {
     if (!$this->slim) {
         $testCase = new WebTestCase();
         $this->slim = $testCase->getSlimInstance();
         $methods = $this->getValidRequestMethods();
         $callback = function () {
             echo 'This is a test!';
         };
         foreach ($methods as $method) {
             $this->slim->{$method}($this->getValidUri(), $callback);
         }
     }
     return $this->slim;
 }
 private function getSlimInstance()
 {
     if (!$this->slim) {
         $testCase = new WebTestCase();
         $this->slim = $testCase->getSlimInstance();
         $methods = $this->getValidRequestMethods();
         $callback = function ($req, $res) {
             return $res->write('This is a test!');
         };
         foreach ($methods as $method) {
             $this->slim->map([$method], $this->getValidUri(), $callback);
         }
     }
     return $this->slim;
 }
 public function tearDown()
 {
     while (ob_get_level() > $this->ob_level) {
         echo ob_get_contents();
         ob_end_clean();
     }
     parent::tearDown();
 }
예제 #6
0
 public function setup()
 {
     \Propel\Runtime\Propel::disableInstancePooling();
     parent::setup();
 }