/** * @test * @runInSeparateProcess * @preserveGlobalState false */ public function returnsTestResource() { $path = 'Foo/Bar.txt'; $str = 'foobar'; PHPMockery::mock(__NAMESPACE__, 'file_get_contents')->andReturn($str); $this->assertSame($str, static::$resourceProvider->getTestResource($path)); }
/** * Returns the input in `input.txt` within a given day's directory. * * *Example:* Providing `1` for the day will return contents in `/src/main/Day1/input.txt` * * @param int $day * @return string contents of input file */ public function getInputFromFileForDay($day) { Validator::intType()->check($day); return $this->resourceProvider->getResource("Day{$day}/input.txt"); }