public function testStartGotSession() { $payload = ['id' => $this->sessionId, 'queues' => ['data' => ['name' => 'main', 'pages' => 1, 'total_count' => 2], 'meta' => ['type' => 'sync_queue']]]; $httpResponse = [201, $payload]; $http = $this->getMockBuilder('\\BaseCRM\\HttpClient')->disableOriginalConstructor()->getMock(); $http->expects($this->once())->method('post')->with('/sync/start', null, ['headers' => ['X-Basecrm-Device-UUID' => $this->deviceUUID]])->will($this->returnValue($httpResponse)); $sync = new SyncService($http); $this->assertEquals($sync->start($this->deviceUUID), $payload); }