/** * test that component components are not enabled in the collection. * * @return void */ public function testInnerComponentsAreNotEnabled() { $mock = $this->getMock('Cake\\Event\\EventManager'); $controller = new Controller(); $controller->setEventManager($mock); $mock->expects($this->once())->method('attach')->with($this->isInstanceOf('TestApp\\Controller\\Component\\AppleComponent')); $Collection = new ComponentRegistry($controller); $Apple = $Collection->load('Apple'); $this->assertInstanceOf('TestApp\\Controller\\Component\\OrangeComponent', $Apple->Orange, 'class is wrong'); }