예제 #1
0
 /**
  * Validate plugin interface
  *
  * @param string $plugin
  * @param string $type
  */
 protected function validatePlugins($plugin, $type)
 {
     try {
         $module = \Magento\Framework\App\Utility\Classes::getClassModuleName($type);
         if (\Magento\Framework\App\Utility\Files::init()->isModuleExists($module)) {
             $this->pluginValidator->validate($plugin, $type);
         }
     } catch (\Magento\Framework\Interception\Code\ValidatorException $exception) {
         $this->fail($exception->getMessage());
     }
 }
 /**
  * @expectedException \Magento\Framework\Exception\ValidatorException
  * @expectedExceptionMessage Invalid [] $name type in
  * @covers \Magento\Framework\Interception\Code\InterfaceValidator::validate
  */
 public function testValidateInvalidProceed()
 {
     $this->model->validate('\\Magento\\Framework\\Interception\\Test\\Unit\\Custom\\Module\\Model\\InterfaceValidator\\ItemPlugin\\InvalidProceed', '\\Magento\\Framework\\Interception\\Test\\Unit\\Custom\\Module\\Model\\InterfaceValidator\\Item');
 }
예제 #3
0
 /**
  * Validate plugin and intercepted class
  *
  * @param string $pluginClass
  * @param string $interceptedType
  * @throws ValidatorException
  */
 public function validate($pluginClass, $interceptedType)
 {
     $this->frameworkValidator->validate($pluginClass, $interceptedType);
     $this->validateClassNameMatchesCase($pluginClass);
     $this->validateClassNameMatchesCase($interceptedType);
 }