Uecode\Bundle\QPushBundle\Provider\FileProvider::create PHP Method

create() public method

public create ( )
    public function create()
    {
        $fs = new Filesystem();
        if (!$fs->exists($this->queuePath)) {
            $fs->mkdir($this->queuePath);
            return $fs->exists($this->queuePath);
        }
        return true;
    }

Usage Example

Ejemplo n.º 1
0
 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'));
 }
All Usage Examples Of Uecode\Bundle\QPushBundle\Provider\FileProvider::create