/** * Tests if the merge method fails with an exception if the class * name doesn't match when try to merge to descriptor instances. * * @return void * @expectedException AppserverIo\Psr\Servlet\ServletException */ public function testMergeWithException() { // initialize the configuration $node = new ServletNode(); $node->initFromFile(__DIR__ . '/_files/dd-servlet.xml'); // initialize the descriptor from the nodes data $this->descriptor->fromConfiguration($node); // initialize the descriptor to merge $descriptorToMerge = $this->getMockForAbstractClass('AppserverIo\\Description\\ServletDescriptor'); // initialize the configuration of the descriptor to be merged $nodeToMerge = new ServletNode(); $nodeToMerge->initFromFile(__DIR__ . '/_files/dd-servlet-to-merge-with-exception.xml'); $descriptorToMerge->fromConfiguration($nodeToMerge); // merge the descriptors $this->descriptor->merge($descriptorToMerge); }
/** * Tests the static newDescriptorInstance() method. * * @return void */ public function testNewDescriptorInstance() { $this->assertInstanceOf('AppserverIo\\Description\\ServletDescriptor', ServletDescriptor::newDescriptorInstance()); }