public function test_factory_shouldNotFindAComponent_IfPluginIsLoadedButNotActivated() { PluginManager::getInstance()->loadPlugin('ExampleReport'); $module = 'ExampleReport'; $action = 'GetExampleReport'; $report = ComponentFactory::factory($module, $action, self::REPORT_CLASS_NAME); $this->assertNull($report); }
/** * Get an instance of a specific report belonging to the given module and having the given action. * @param string $module * @param string $action * @return null|\Piwik\Plugin\Report * @api */ public static function factory($module, $action) { return ComponentFactory::factory($module, ucfirst($action), __CLASS__); }
/** * Creates a Dimension instance from a string ID (see {@link getId()}). * * @param string $dimensionId See {@link getId()}. * @return Dimension|null The created instance or null if there is no Dimension for * $dimensionId or if the plugin that contains the Dimension is * not loaded. * @api */ public static function factory($dimensionId) { list($module, $dimension) = explode('.', $dimensionId); return ComponentFactory::factory($module, $dimension, __CLASS__); }