object = new PMmemcached('workflow'); } /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ protected function tearDown() { } /** * This is the default method to test, if the class still having * the same number of methods. */ public function testNumberOfMethodsInThisClass() { $methods = get_class_methods('PMmemcached'); $this->assertTrue( count($methods) == 12); } /** * @covers PMmemcached::__construct * @todo Implement test__construct(). */ public function test__construct() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('__construct', $methods ), 'exists method __construct' ); $r = new ReflectionMethod('PMmemcached', '__construct'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'workspace'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); } /** * @covers PMmemcached::getSingleton * @todo Implement testgetSingleton(). */ public function testgetSingleton() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('getSingleton', $methods ), 'exists method getSingleton' ); $r = new ReflectionMethod('PMmemcached', 'getSingleton'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'workspace'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); } /** * @covers PMmemcached::__clone * @todo Implement test__clone(). */ public function test__clone() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('__clone', $methods ), 'exists method __clone' ); $r = new ReflectionMethod('PMmemcached', '__clone'); $params = $r->getParameters(); } /** * @covers PMmemcached::__wakeup * @todo Implement test__wakeup(). */ public function test__wakeup() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('__wakeup', $methods ), 'exists method __wakeup' ); $r = new ReflectionMethod('PMmemcached', '__wakeup'); $params = $r->getParameters(); } /** * @covers PMmemcached::set * @todo Implement testset(). */ public function testset() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('set', $methods ), 'exists method set' ); $r = new ReflectionMethod('PMmemcached', 'set'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'key'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue( $params[1]->getName() == 'object'); $this->assertTrue( $params[1]->isArray() == false); $this->assertTrue( $params[1]->isOptional () == false); $this->assertTrue( $params[2]->getName() == 'timeout'); $this->assertTrue( $params[2]->isArray() == false); $this->assertTrue( $params[2]->isOptional () == true); $this->assertTrue( $params[2]->getDefaultValue() == '0'); } /** * @covers PMmemcached::get * @todo Implement testget(). */ public function testget() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('get', $methods ), 'exists method get' ); $r = new ReflectionMethod('PMmemcached', 'get'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'key'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); } /** * @covers PMmemcached::add * @todo Implement testadd(). */ public function testadd() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('add', $methods ), 'exists method add' ); $r = new ReflectionMethod('PMmemcached', 'add'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'key'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue( $params[1]->getName() == 'value'); $this->assertTrue( $params[1]->isArray() == false); $this->assertTrue( $params[1]->isOptional () == false); } /** * @covers PMmemcached::increment * @todo Implement testincrement(). */ public function testincrement() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('increment', $methods ), 'exists method increment' ); $r = new ReflectionMethod('PMmemcached', 'increment'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'key'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue( $params[1]->getName() == 'value'); $this->assertTrue( $params[1]->isArray() == false); $this->assertTrue( $params[1]->isOptional () == false); } /** * @covers PMmemcached::delete * @todo Implement testdelete(). */ public function testdelete() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('delete', $methods ), 'exists method delete' ); $r = new ReflectionMethod('PMmemcached', 'delete'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'key'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); } /** * @covers PMmemcached::flush * @todo Implement testflush(). */ public function testflush() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('flush', $methods ), 'exists method flush' ); $r = new ReflectionMethod('PMmemcached', 'flush'); $params = $r->getParameters(); } /** * @covers PMmemcached::getStats * @todo Implement testgetStats(). */ public function testgetStats() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('getStats', $methods ), 'exists method getStats' ); $r = new ReflectionMethod('PMmemcached', 'getStats'); $params = $r->getParameters(); } /** * @covers PMmemcached::printDetails * @todo Implement testprintDetails(). */ public function testprintDetails() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('printDetails', $methods ), 'exists method printDetails' ); $r = new ReflectionMethod('PMmemcached', 'printDetails'); $params = $r->getParameters(); } }