Beispiel #1
0
 /**
  * @return void
  */
 public function testCheckSettingOfEncodingWithMethod()
 {
     $this->assertContains('This is a File', file_get_contents($this->_newFile));
     try {
         $filter = new FileUpperCase();
         $filter->setEncoding('ISO-8859-1');
         $filter($this->_newFile);
         $this->assertContains('THIS IS A FILE', file_get_contents($this->_newFile));
     } catch (\Zend\Filter\Exception\ExtensionNotLoadedException $e) {
         $this->assertContains('mbstring is required', $e->getMessage());
     }
 }
Beispiel #2
0
 /**
  * @dataProvider returnUnfilteredDataProvider
  * @return void
  */
 public function testReturnUnfiltered($input)
 {
     $filter = new FileUpperCase();
     $filter->setEncoding('ISO-8859-1');
     $this->assertEquals($input, $filter($input));
 }