/** * Test the to array function * * @return void * @author Dan Cox */ public function test_toArray() { $tool = new ModuleTool(); $tool->addCommand('NewCommand'); $settings = $tool->toArray(); $this->assertEquals(array('commands' => array('NewCommand'), 'entity' => array()), $settings); }
/** * Read and write * * @return void * @author Dan Cox */ public function test_readFromAndWrite() { $this->config->shouldReceive('load')->andReturn($this->config); $this->config->shouldReceive('params')->andReturn($this->config); $this->config->shouldReceive('save'); $tool = new ModuleTool(); $tool->addCommand('NewCommand'); $cache = new ModuleCache(); $cache->readFrom('mod', $tool); $this->assertEquals(array('commands' => array('NewCommand'), 'entity' => array()), $this->config->mod); }