Thank you. That was helped.
public function setUp() {
parent::setUp();
$controller = $this->getMock('Cake\Controller\Controller', [
'redirect']);
$this->registry = new ComponentRegistry($controller);
$this->component = new RBruteForceComponent($this->registry);
You will need to pass a controller instance to the ComponentRegistry,
otherwise there will be none to get in the component's initialise function
On Sunday, November 2, 2014 3:12:54 PM UTC+1, Radharadhya Dasa wrote:
>
> Hi, I am not able to create a test for my plugins component.
>
> Component:
>
Hi, I am not able to create a test for my plugins component.
Component:
namespace RBruteForce\Controller\Component;
use Cake\Controller\Component;
use Cake\Routing\Router;
use Cake\ORM\TableRegistry;
class RBruteForceComponent extends Component {
public function initialize(array $config) {