zeroOrMoreTimes()->andReturnFirstArg(); $stopwatch = new Stopwatch(); $collector = new Hook_Collector( $stopwatch, [ 'core' => new Core_Events() ] ); $this->assertTrue( (bool) has_action( 'after_setup_theme', [ $collector, 'after_setup_theme' ] ) ); $this->assertTrue( (bool) has_action( 'plugins_loaded', 'function ($input)' ) ); $collector->after_setup_theme(); $stopwatch->start( 'Toolbar' ); $collector->get_records(); $this->assertFalse( $stopwatch->isStarted( 'Toolbar' ) ); } }