コード例 #1
0
 public function testConfiguration1()
 {
     try {
         $this->_dataServiceConfiguration->setMaxExpandCount(-123);
         $this->fail('An expected InvalidArgumentException for \'non-negative parameter\' was not thrown for month');
     } catch (\InvalidArgumentException $exception) {
         $this->assertStringEndsWith('should be non-negative, negative value \'-123\' passed', $exception->getMessage());
     }
     try {
         $this->_dataServiceConfiguration->setMaxExpandDepth('ABCS');
         $this->fail('An expected InvalidArgumentException for \'non-integer parameter\' was not thrown for month');
     } catch (\InvalidArgumentException $exception) {
         $this->assertStringEndsWith('should be integer, non-integer value \'ABCS\' passed', $exception->getMessage());
     }
     $this->assertEquals($this->_dataServiceConfiguration->getMaxExpandCount(), PHP_INT_MAX);
     $this->assertEquals($this->_dataServiceConfiguration->getMaxExpandDepth(), PHP_INT_MAX);
     $this->_dataServiceConfiguration->setMaxExpandCount(6);
     $this->_dataServiceConfiguration->setMaxExpandDepth(10);
     $this->assertEquals($this->_dataServiceConfiguration->getMaxExpandCount(), 6);
     $this->assertEquals($this->_dataServiceConfiguration->getMaxExpandDepth(), 10);
 }