8 require_once
'_files/ClassesForTypeDuplication.php';
23 $path = realpath(
__DIR__) .
'/' .
'_files' .
'/' .
'ClassesForTypeDuplication.php';
24 $this->_fixturePath = str_replace(
'\\',
'/',
$path);
25 $this->_validator = new \Magento\Framework\Code\Validator\TypeDuplication();
34 $this->assertTrue($this->_validator->validate(
$className));
43 'Duplicated interface injection' => [
'\TypeDuplication\ValidClassWithTheSameInterfaceTypeArguments'],
44 'Class with sub type arguments' => [
'\TypeDuplication\ValidClassWithSubTypeArguments'],
45 'Class with SuppressWarnings' => [
'\TypeDuplication\ValidClassWithSuppressWarnings']
51 $message =
'Argument type duplication in class TypeDuplication\InvalidClassWithDuplicatedTypes in ' .
54 'Multiple type injection [\TypeDuplication\ArgumentBaseClass]';
55 $this->expectException(\
Magento\Framework\Exception\ValidatorException::class);
56 $this->expectExceptionMessage(
$message);
57 $this->_validator->validate(
'\TypeDuplication\InvalidClassWithDuplicatedTypes');
validClassesDataProvider()
defined('TESTS_BP')||define('TESTS_BP' __DIR__
testValidClasses($className)