From 6984e737b706c73baaa5c3c921762706f958d4da Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Tue, 21 Apr 2020 11:31:27 +0200 Subject: feat: Logger throws Exceptions instead of die added FilesTests for future files related tests --- tests/FilesTest.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/FilesTest.php (limited to 'tests/FilesTest.php') diff --git a/tests/FilesTest.php b/tests/FilesTest.php new file mode 100644 index 0000000..7ab66fe --- /dev/null +++ b/tests/FilesTest.php @@ -0,0 +1,33 @@ +testdir + * - $this->notwritabledir + * - $this->notwritablefile + */ +abstract class FilesTest extends TestCase +{ + protected $testdir = 'build/test'; + protected $notwritabledir = 'build/test/notwritabledir'; + protected $notwritablefile = 'build/test/notwritablefile'; + + protected function setUp(): void + { + parent::setUp(); + if (!is_dir($this->testdir)) { + mkdir($this->testdir, 0755, true); + } + if (!file_exists($this->notwritabledir)) { + mkdir($this->notwritabledir, 0000); + } + if (!file_exists($this->notwritablefile)) { + touch($this->notwritablefile); + chmod($this->notwritablefile, 0000); + } + } +} -- cgit v1.2.3