示例#1
0
文件: GzTest.php 项目: haoyanfei/zf2
 /**
  * Setting Mode
  *
  * @return void
  */
 public function testGzGetSetMode()
 {
     $filter = new GzCompression();
     $this->assertEquals('compress', $filter->getMode());
     $filter->setMode('deflate');
     $this->assertEquals('deflate', $filter->getOptions('mode'));
     $this->setExpectedException('Zend\\Filter\\Exception\\InvalidArgumentException', 'mode not supported');
     $filter->setMode('unknown');
 }
示例#2
0
 /**
  * Setting Mode
  *
  * @return void
  */
 public function testGzGetSetMode()
 {
     $filter = new GzCompression();
     $this->assertEquals('compress', $filter->getMode());
     $filter->setMode('deflate');
     $this->assertEquals('deflate', $filter->getOptions('mode'));
     try {
         $filter->setMode('unknown');
         $this->fail('Exception expected');
     } catch (\Zend\Filter\Exception $e) {
         $this->assertContains('mode not supported', $e->getMessage());
     }
 }