From ea549328d0177d6bd10c9aae669b1b2c5e9b91fe Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Tue, 19 Aug 2008 07:14:03 +0000 Subject: [PATCH] MDL-15666 Adding test file with stub methods. --- lib/simpletest/testportfoliolib.php | 108 ++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100755 lib/simpletest/testportfoliolib.php diff --git a/lib/simpletest/testportfoliolib.php b/lib/simpletest/testportfoliolib.php new file mode 100755 index 0000000000..afeed65fee --- /dev/null +++ b/lib/simpletest/testportfoliolib.php @@ -0,0 +1,108 @@ +libdir . '/portfoliolib.php'); + +class portfolio_plugin_test extends portfolio_plugin_push_base { + public function expected_time($callertime){} + public function is_push(){} + public function prepare_package(){} + public function send_package(){} + public function get_continue_url(){} +} + +class portfolio_caller_test extends portfolio_caller_base { + private $content; + + public function __construct($content) { + $this->content = $content; + } + + public function expected_time() { + return PORTFOLIO_TIME_LOW; + } + + public function get_navigation() { + $extranav = array('name' => 'Test caller class', 'link' => $this->get_return_url()); + return array($extranav, 'test'); + } + + public function get_sha1(){ + return sha1($this->content); + } + + public function prepare_package() { + + } + + public function get_return_url() { + return ''; + } + + public function check_permissions() { + return true; + } + + public static function display_name() { + return "Test caller subclass"; + } +} + +Mock::generate('portfolio_caller_test', 'mock_caller'); +Mock::generate('portfolio_plugin_test', 'mock_plugin'); + +class portfoliolib_test extends UnitTestCase { + public $caller; + public $plugin; + public $exporter; + + function setUp() { + $this->plugin = new mock_plugin(); + $this->caller = new mock_caller(); + $this->exporter = new portfolio_exporter(&$this->plugin, &$this->caller, '', array()); + } + + function tearDown() { + + } + + function test_construct() { + + } +} + +?> -- 2.39.5