AppserverIo\Appserver\Core\Api\AppServiceTest::testNewFromApplication PHP 메소드

testNewFromApplication() 공개 메소드

Will test if we can successfully add an app to the configuration based on a given application object
public testNewFromApplication ( ) : null
리턴 null
    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);
    }