示例#1
0
文件: SlimTest.php 项目: rs3d/Slimplr
 /**
  * Test get default instance
  */
 public function testGetDefaultInstance()
 {
     $s = new Slim();
     $s->setName('default');
     //We must do this manually since a default app is already set in prev tests
     $this->assertEquals('default', $s->getName());
     $this->assertInstanceOf('Slim', Slim::getInstance());
     $this->assertSame($s, Slim::getInstance());
 }
示例#2
0
 /**
  * Test Slim get instance
  *
  * Pre-conditions:
  * Slim app instantiated;
  * Set app name;
  *
  * Post-conditions:
  * A default app exists;
  * The instantiated app is returned by the name assigned to it;
  */
 public function testGetInstance()
 {
     $app = new Slim();
     $app->setName('foo');
     $this->assertTrue(Slim::getInstance() instanceof Slim);
     $this->assertEquals('foo', $app->getName());
     $this->assertSame($app, Slim::getInstance('foo'));
 }