Exemple #1
0
 /**
  * strict モードが ON の場合, 不正な文字を含む base64 文字列のデコード結果が
  * false になることを確認します.
  * 
  * @covers Peach\DF\Base64Codec::decode
  */
 public function testDecodeWithStrict()
 {
     $obj1 = Base64Codec::getInstance(false);
     $obj2 = Base64Codec::getInstance(true);
     $test = "SGVs,bG8g,V29y,bGQh";
     $this->assertSame("Hello World!", $obj1->decode($test));
     $this->assertFalse($obj2->decode($test));
 }
Exemple #2
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $first = new JsonCodec();
     $second = Base64Codec::getInstance();
     $this->object = new CodecChain($first, $second);
 }