From 01bb9edc805a3eb77a65b8040a81a4eba0110ff7 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 4 Oct 2022 13:38:14 +0200 Subject: [PATCH] tests: refactoring --- tests/PhpGenerator/Extractor.extractAll.phpt | 55 +------------------- tests/PhpGenerator/expected/Extractor.expect | 22 ++++++++ tests/PhpGenerator/fixtures/extractor.php | 21 ++++++++ 3 files changed, 45 insertions(+), 53 deletions(-) create mode 100644 tests/PhpGenerator/expected/Extractor.expect create mode 100644 tests/PhpGenerator/fixtures/extractor.php diff --git a/tests/PhpGenerator/Extractor.extractAll.phpt b/tests/PhpGenerator/Extractor.extractAll.phpt index c680d860..e7ed4b89 100644 --- a/tests/PhpGenerator/Extractor.extractAll.phpt +++ b/tests/PhpGenerator/Extractor.extractAll.phpt @@ -30,59 +30,8 @@ sameFile(__DIR__ . '/expected/Extractor.traits.expect', (string) $file); $file = (new Extractor(file_get_contents(__DIR__ . '/fixtures/bodies.php')))->extractAll(); sameFile(__DIR__ . '/expected/Extractor.bodies.expect', (string) $file); -$file = (new Extractor( - <<<'XX' -extractAll(); -Assert::type(Nette\PhpGenerator\PhpFile::class, $file); -Assert::match(<<<'XX' -extractAll(); +sameFile(__DIR__ . '/expected/Extractor.expect', (string) $file); Assert::exception(function () { (new Extractor('')); diff --git a/tests/PhpGenerator/expected/Extractor.expect b/tests/PhpGenerator/expected/Extractor.expect new file mode 100644 index 00000000..dc56a7e3 --- /dev/null +++ b/tests/PhpGenerator/expected/Extractor.expect @@ -0,0 +1,22 @@ +