From 2892e3dcadbb323998b581c7789dbe7e3ddcf847 Mon Sep 17 00:00:00 2001 From: Hassan Khan Date: Sat, 8 Feb 2014 23:39:32 +0000 Subject: [PATCH] Added test mock-type thingies for testing ``Zepto\FileLoader\PluginLoader`` --- tests/Zepto/FileLoader/PluginLoaderTest.php | 6 ++-- tests/mocks/NoImplementInterfacePlugin.php | 37 +++++++++++++++++++++ tests/mocks/WrongNamePlugin.php | 37 +++++++++++++++++++++ tests/mocks/invalid_Plugin.php | 37 +++++++++++++++++++++ 4 files changed, 114 insertions(+), 3 deletions(-) create mode 100644 tests/mocks/NoImplementInterfacePlugin.php create mode 100644 tests/mocks/WrongNamePlugin.php create mode 100644 tests/mocks/invalid_Plugin.php diff --git a/tests/Zepto/FileLoader/PluginLoaderTest.php b/tests/Zepto/FileLoader/PluginLoaderTest.php index 58fe7e1..cb1aedb 100644 --- a/tests/Zepto/FileLoader/PluginLoaderTest.php +++ b/tests/Zepto/FileLoader/PluginLoaderTest.php @@ -66,7 +66,7 @@ public function testLoadSingleFile() */ public function testLoadInvalidPluginName() { - $this->loader = new PluginLoader(ROOT_DIR . 'tests/'); + $this->loader = new PluginLoader(ROOT_DIR . 'tests/mocks/'); $actual = $this->loader->load('invalid_Plugin.php'); } @@ -76,7 +76,7 @@ public function testLoadInvalidPluginName() */ public function testLoadWithPluginThatDoesNotHaveSameClassName() { - $this->loader = new PluginLoader(ROOT_DIR . 'tests/'); + $this->loader = new PluginLoader(ROOT_DIR . 'tests/mocks/'); $actual = $this->loader->load('WrongNamePlugin.php'); } @@ -86,7 +86,7 @@ public function testLoadWithPluginThatDoesNotHaveSameClassName() */ public function testLoadWithPluginThatDoesNotImplementInterface() { - $this->loader = new PluginLoader(ROOT_DIR . 'tests/'); + $this->loader = new PluginLoader(ROOT_DIR . 'tests/mocks/'); $actual = $this->loader->load('NoImplementInterfacePlugin.php'); } diff --git a/tests/mocks/NoImplementInterfacePlugin.php b/tests/mocks/NoImplementInterfacePlugin.php new file mode 100644 index 0000000..f00102c --- /dev/null +++ b/tests/mocks/NoImplementInterfacePlugin.php @@ -0,0 +1,37 @@ +