Esempio n. 1
0
 public function testCompositeThrowsExceptionOnInvalidStrategyPart2()
 {
     $strategy = new Strategy\Composite(array(), 'invalid');
     $strategy->connectTypeToStrategy('Book', 'strategy');
     $this->setExpectedException('Zend\\Soap\\Exception\\InvalidArgumentException', 'Default Strategy for Complex Types is not a valid strategy object');
     $book = $strategy->getStrategyOfType('Anything');
 }
Esempio n. 2
0
 public function testCompositeThrowsExceptionOnInvalidStrategy()
 {
     $strategy = new Strategy\Composite(array(), 'invalid');
     $strategy->connectTypeToStrategy('Book', 'strategy');
     try {
         $book = $strategy->getStrategyOfType('Book');
         $this->fail();
     } catch (\Exception $e) {
         $this->assertTrue($e instanceof WSDL\Exception);
     }
     try {
         $book = $strategy->getStrategyOfType('Anything');
         $this->fail();
     } catch (\Exception $e) {
         $this->assertTrue($e instanceof WSDL\Exception);
     }
 }