本文整理汇总了PHP中Slim::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Slim::getName方法的具体用法?PHP Slim::getName怎么用?PHP Slim::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Slim
的用法示例。
在下文中一共展示了Slim::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetDefaultInstance
/**
* 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: testGetInstance
/**
* 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'));
}