Commit: 24689dea0370ea62225de36a8deeaa9279b8a90d

Author: gwoo | Date: 2010-01-28 22:22:35 -0800
adding mocks
diff --git a/tests/mocks/extensions/command/MockIrcSocket.php b/tests/mocks/extensions/command/MockIrcSocket.php new file mode 100644 index 0000000..e2c68dc --- /dev/null +++ b/tests/mocks/extensions/command/MockIrcSocket.php @@ -0,0 +1,49 @@ +<?php +/** + * Lithium: the most rad php framework + * + * @copyright Copyright 2010, Union of RAD (http://union-of-rad.org) + * @license http://opensource.org/licenses/bsd-license.php The BSD License + */ + +namespace li3_bot\tests\mocks\extensions\command; + +class MockIrcSocket extends \lithium\util\Socket { + + protected $_data = null; + + public function open() { + $this->_resource = fopen('php://memory', 'w+'); + return true; + } + + public function close() { + return true; + } + + public function eof() { + return true; + } + + public function read() { + fgets($this->_resource); + } + + public function write($data) { + fwrite($this->_resource, $data); + } + + public function timeout($time) { + return true; + } + + public function encoding($charset) { + return true; + } + + public function send($message, $options = array()) { + return true; + } +} + +?> \ No newline at end of file diff --git a/tests/mocks/extensions/command/bot/MockIrc.php b/tests/mocks/extensions/command/bot/MockIrc.php new file mode 100644 index 0000000..e88a254 --- /dev/null +++ b/tests/mocks/extensions/command/bot/MockIrc.php @@ -0,0 +1,17 @@ +<?php +/** + * Lithium: the most rad php framework + * + * @copyright Copyright 2009, Union of RAD (http://union-of-rad.org) + * @license http://opensource.org/licenses/bsd-license.php The BSD License + */ + +namespace li3_bot\tests\mocks\extensions\command\bot; + +class MockIrc extends \li3_bot\extensions\command\bot\Irc { + + public function process() { + return $this->_process(); + } + +} \ No newline at end of file