Пример #1
0
 /**
  * Test get named instance
  */
 public function testGetNamedInstance()
 {
     $s = new Slim();
     $s->setName('foo');
     $this->assertSame($s, Slim::getInstance('foo'));
 }
Пример #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'));
 }