public function testGetLockFile() { $expected = $this->minifyJson(file_get_contents($this->testProjectFolder . DIRECTORY_SEPARATOR . 'composer.lock')); $cl = new ComposerLocator(new Filesystem(), $this->testPackageFolder . DIRECTORY_SEPARATOR . '..'); $actual = $cl->getLockFile(); $this->assertJson($actual, 'The composer.lock file does not contain valid JSON.'); $this->assertEquals($expected, $actual); }
public function testShowLockFile() { $expectedResult = $this->composerLocator->getLockFile(); $composerServer = new ComposerServer($this->composerLocator); $actualResult = $composerServer->showLockFile(); $this->assertJson($actualResult->getContent()); $this->assertEquals($expectedResult, $actualResult->getContent()); }
/** * Sends the composer.lock file to $this->url * * @param string $apiKey * * @return bool eturns true on success (HTTP 200) */ public function sendLockFile($apiKey) { $response = $this->client->get($this->url, ['headers' => ['Authorization' => 'apiKey:' . $apiKey], 'body' => $this->composerLocator->getLockFile()]); return $response->getStatusCode() == 200; }
/** * @param bool $send if true sends the headers & contents to the browser * * @return Response */ public function showJsonFile($send = false) { $response = $this->createResponse($this->composerLocator->getJsonFile()); return $send ? $response->send() : $response; }