for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Communibase;
use GuzzleHttp\Promise\FulfilledPromise;
/**
* @package Communibase
* @author Kingsquare ([email protected])
* @copyright Copyright (c) Kingsquare BV (http://www.kingsquare.nl)
*/
class SyncTest extends \PHPUnit_Framework_TestCase
{
* @test
public function sync()
$result = $this->getMockConnector()->getByIdSync('Person', $this->getMockConnector()->generateId());
$this->assertSame([], $result);
}
public function async()
$this->getMockConnector()->getById('Person', $this->getMockConnector()->generateId())->then(function ($result) {
})->wait(); // wait to complete the test ;-)
* @return \Communibase\Connector
protected function getMockConnector()
$mock = $this->getMockBuilder('Communibase\Connector')
->setMethods(['getResult'])
->disableOriginalConstructor()
->getMock();
$mock->expects($this->any())
->method('getResult')
->will($this->returnValue(new FulfilledPromise([])));
return $mock;