File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
tests/cases/libs/controller Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -298,13 +298,23 @@ class EmailComponent extends Component {
298
298
*/
299
299
protected $ _smtpConnection = null ;
300
300
301
+ /**
302
+ * Constructor
303
+ *
304
+ * @param ComponentCollection $collection A ComponentCollection this component can use to lazy load its components
305
+ * @param array $settings Array of configuration settings.
306
+ */
307
+ public function __construct (ComponentCollection $ collection , $ settings = array ()) {
308
+ $ this ->Controller = $ collection ->getController ();
309
+ parent ::__construct ($ collection , $ settings );
310
+ }
311
+
301
312
/**
302
313
* Initialize component
303
314
*
304
315
* @param object $controller Instantiating controller
305
316
*/
306
317
public function initialize (&$ controller ) {
307
- $ this ->Controller = $ controller ;
308
318
if (Configure::read ('App.encoding ' ) !== null ) {
309
319
$ this ->charset = Configure::read ('App.encoding ' );
310
320
}
Original file line number Diff line number Diff line change @@ -533,7 +533,7 @@ public function getResponse() {
533
533
* @return void
534
534
*/
535
535
public function startupProcess () {
536
- $ this ->Components ->trigger ('initialize ' , array (&$ this ), array ( ' triggerDisabled ' => true ) );
536
+ $ this ->Components ->trigger ('initialize ' , array (&$ this ));
537
537
$ this ->beforeFilter ();
538
538
$ this ->Components ->trigger ('startup ' , array (&$ this ));
539
539
}
Original file line number Diff line number Diff line change @@ -1478,7 +1478,7 @@ function testStartupProcess() {
1478
1478
1479
1479
$ Controller ->expects ($ this ->once ())->method ('beforeFilter ' );
1480
1480
$ Controller ->Components ->expects ($ this ->at (0 ))->method ('trigger ' )
1481
- ->with ('initialize ' , array (&$ Controller ), array ( ' triggerDisabled ' => true ) );
1481
+ ->with ('initialize ' , array (&$ Controller ));
1482
1482
1483
1483
$ Controller ->Components ->expects ($ this ->at (1 ))->method ('trigger ' )
1484
1484
->with ('startup ' , array (&$ Controller ));
You can’t perform that action at this time.
0 commit comments