/** * Test if the load() method returns the correct app node. * * @return void */ public function testLoad() { $appNode = new AppNode(); $appNode->setNodeName('application'); $appNode->setWebappPath('/opt/appserver/anotherwebapppath'); $appNode->setName('someappname'); $this->appService->persist($appNode); $this->assertSame($appNode, $this->appService->load($appNode->getPrimaryKey())); }
/** * Returns an new app node instance. * * @param \TechDivision\Application\Interfaces\ApplicationInterface $application The application to create a new app node instance from * * @return \TechDivision\ApplicationServer\Api\Node\AppNode The app node representation of the application */ protected function create(ApplicationInterface $application) { // create a new AppNode and initialize it with the values from this instance $appNode = new AppNode(); $appNode->setNodeName(AppService::NODE_NAME); $appNode->setUuid($appNode->newUuid()); $appNode->setName($application->getName()); $appNode->setWebappPath($application->getWebappPath()); $appNode->setDatasources($application->getDatasources()); // return the AppNode instance return $appNode; }
/** * Test if it is possible to attach a new app. * * @return void */ public function testAttachApp() { $appNode = new AppNode(); $appNode->setNodeName('application'); $appNode->setName('someApp'); $appNode->setWebappPath('/someApp'); $this->appserverNode->attachApp($appNode); $this->assertCount(5, $this->appserverNode->getApps()); }