public function testNewFromApplication()
{
// create a basic mock for our abstract service class
$mockApp = $this->getMock('\\AppserverIo\\Psr\\Application\\ApplicationInterface');
$mockApp->expects($this->once())->method('getName')->will($this->returnValue(__METHOD__));
$this->appService->newFromApplication($mockApp);
$apps = $this->appService->getSystemConfiguration()->getApps();
$foundApp = false;
foreach ($apps as $app) {
if ($app->getName() === __METHOD__) {
$foundApp = true;
break;
}
}
$this->assertTrue($foundApp);
}