1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-12 17:17:20 +01:00
parallel/test/Sync/ChannelParserTest.php

20 lines
549 B
PHP
Raw Normal View History

2017-12-14 06:06:38 +01:00
<?php
namespace Amp\Parallel\Test\Sync;
use Amp\Parallel\Sync\ChannelParser;
use Amp\PHPUnit\TestCase;
class ChannelParserTest extends TestCase {
/**
* @expectedException \Amp\Parallel\Sync\SerializationException
* @expectedExceptionMessage Exception thrown when unserializing data
*/
public function testCorruptedData() {
$data = "Invalid serialized data";
$data = \pack("CL", 0, \strlen($data)) . $data;
$parser = new ChannelParser($this->createCallback(0));
$parser->push($data);
}
}