Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Commit

Permalink
Added test mock-type thingies for testing ``Zepto\FileLoader\PluginLo…
Browse files Browse the repository at this point in the history
…ader``
  • Loading branch information
hassankhan committed Feb 8, 2014
1 parent 6b6d6af commit 2892e3d
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/Zepto/FileLoader/PluginLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand All @@ -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');
}

Expand All @@ -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');
}

Expand Down
37 changes: 37 additions & 0 deletions tests/mocks/NoImplementInterfacePlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

class NoImplementInterfacePlugin {

public function after_plugins_load()
{
}

public function before_config_load(&$settings)
{
}

public function before_content_load(&$content_dir)
{
}

public function after_content_load(&$content)
{
}

public function before_router_setup()
{
}

public function after_router_setup()
{
}

public function before_response_send()
{
}

public function after_response_send()
{
}

}
37 changes: 37 additions & 0 deletions tests/mocks/WrongNamePlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

class SomeOtherRandomNameHerePlugin {

public function after_plugins_load()
{
}

public function before_config_load(&$settings)
{
}

public function before_content_load(&$content_dir)
{
}

public function after_content_load(&$content)
{
}

public function before_router_setup()
{
}

public function after_router_setup()
{
}

public function before_response_send()
{
}

public function after_response_send()
{
}

}
37 changes: 37 additions & 0 deletions tests/mocks/invalid_Plugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

class invalid_Plugin implements \Zepto\PluginInterface {

public function after_plugins_load()
{
}

public function before_config_load(&$settings)
{
}

public function before_content_load(&$content_dir)
{
}

public function after_content_load(&$content)
{
}

public function before_router_setup()
{
}

public function after_router_setup()
{
}

public function before_response_send()
{
}

public function after_response_send()
{
}

}

0 comments on commit 2892e3d

Please sign in to comment.