From 4e2bfed23c17929795f2082d6e77937170caeaa9 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Sun, 13 Sep 2020 21:35:16 +0200 Subject: Turn our functional tests into PhpUnit tests --- tests/functional/BaseTest.php | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 tests/functional/BaseTest.php (limited to 'tests/functional/BaseTest.php') diff --git a/tests/functional/BaseTest.php b/tests/functional/BaseTest.php new file mode 100644 index 0000000..ce045fb --- /dev/null +++ b/tests/functional/BaseTest.php @@ -0,0 +1,55 @@ +ste = new STECore(new TestStorage($this->getDirectory())); + $this->ste->mute_runtime_errors = false; + + $this->setUpSte($this->ste); + } + + protected function setUpSte(STECore $ste): void + { + } + + public function testTemplate(): void + { + $have = $this->ste->exectemplate("test.tpl"); + $want = file_get_contents($this->getDirectory() . DIRECTORY_SEPARATOR . "want"); + + $normalizedHave = self::normalize($have); + $normalizedWant = self::normalize($want); + + self::assertSame($normalizedWant, $normalizedHave); + } + + /** + * Get the directory of the test. + * @return string + */ + abstract protected function getDirectory(): string; +} -- cgit v1.2.3-70-g09d2