public function create()
{
$fs = new Filesystem();
if (!$fs->exists($this->queuePath)) {
$fs->mkdir($this->queuePath);
return $fs->exists($this->queuePath);
}
return true;
}
public function testOnMessageReceived() { $this->provider->create(); $id = $this->provider->publish(['foo' => 'bar']); $path = substr(hash('md5', $id), 0, 3); $this->assertTrue(is_file($this->path . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $id . '.json')); $this->provider->onMessageReceived(new MessageEvent('test', $this->provider->receive()[0])); $this->assertFalse(is_file($this->path . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $id . '.json')); }