/** * Tests entity if execution of command createSubdirectory and search works */ public function testEntityExecutionCreateSubdirectoryWithSearch() { $entityType = '\\AppserverIo\\Concurrency\\ExecutorService\\Entities\\NamingDirectory'; $namingDirectory = ExS\Core::newFromEntity($entityType, 'namingDirectory'); $namingDirectory->createSubdirectory('test'); $testDir = $namingDirectory->search('test'); $this->assertInstanceOf('\\AppserverIo\\Concurrency\\ExecutorService\\Entities\\NamingDirectory', $testDir); }
/** * Test entity execution with circular referencing itself * * @return void */ public function testEntityExecutionWithCircularReferences() { $entityType = '\\stdClass'; $stdClass = ExS\Core::newFromEntity($entityType); $stdClass->__invoke(function ($self) { $self->self = $self; }); $returnedStdClass = $stdClass->__return(); $this->assertInstanceOf($entityType, $returnedStdClass); }
/** * Test getEntity function when created before and ExS was initialised * * @return void */ public function testGetEntityCreatedBeforeInitialised() { $entityType = '\\AppserverIo\\Concurrency\\ExecutorService\\Entities\\Storage'; ExS\Core::init(); ExS\Core::newFromEntity($entityType, 'storage'); $exSentity = ExS\Core::getEntity('storage'); $this->assertInstanceOf('\\AppserverIo\\Concurrency\\ExecutorService', $exSentity); }