public function testLoadFromFile() { $path = __DIR__ . '/config-valid.php'; // valid $loader = new ArrayLoader(); $loader->loadFromFile($path); $this->assertEquals($this->array, $loader->get()); // file not exist try { $loader->loadFromFile('notexist.php'); $this->fail(); } catch (FileIsNotReadableException $e) { $this->assertTrue(true); } // invalid config try { $path = __DIR__ . '/config-invalid.php'; $loader->loadFromFile($path); $this->fail(); } catch (FileNotReturnAnArrayException $e) { $this->assertTrue(true); } }