for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ComposerRequireCheckerTest;
use ComposerRequireChecker\JsonLoader;
use PHPUnit\Framework\TestCase;
/**
* @covers \ComposerRequireChecker\JsonLoader
*/
class JsonLoaderTest extends TestCase
{
* @expectedException \ComposerRequireChecker\Exception\NotReadableException
public function testHasErrorWithWrongPath()
$path = __DIR__ . '/wrong/path/non-existing-file.json';
new JsonLoader($path);
}
* @expectedException \ComposerRequireChecker\Exception\InvalidJsonException
public function testHasErrorWithInvalidFile()
$path = __DIR__ . '/../fixtures/invalidJson';
public function testHasDataWithValidFile()
$path = __DIR__ . '/../fixtures/validJson.json';
$loader = new JsonLoader($path);
$this->assertEquals($loader->getData(), ['foo' => 'bar']);