コード例 #1
0
 public function testUnpackCustomType()
 {
     $obj = new \stdClass();
     $transformer = $this->getTransformerMock(5);
     $transformer->expects($this->once())->method('reverseTransform')->willReturn($obj);
     $coll = $this->getTransformerCollectionMock([$transformer]);
     $coll->expects($this->once())->method('find')->with(5);
     $this->unpacker->setTransformers($coll);
     $this->assertSame($obj, $this->unpacker->reset("�")->unpack());
 }
コード例 #2
0
ファイル: UnpackerTest.php プロジェクト: rybakit/msgpack.php
 public function testUnpack()
 {
     $this->bufferUnpacker->expects($this->once())->method('reset')->with('foo')->willReturn($this->bufferUnpacker);
     $this->bufferUnpacker->expects($this->once())->method('unpack')->willReturn('bar');
     $this->assertSame('bar', $this->unpacker->unpack('foo'));
 }