Definition at line 14 of file ClassesTest.php.
◆ _assertNonFactoryName()
_assertNonFactoryName |
( |
|
$names, |
|
|
|
$file, |
|
|
|
$softComparison = false , |
|
|
|
$moduleBlock = false |
|
) |
| |
|
protected |
Check whether specified classes or module names correspond to a file according PSR-1 Standard.
Suppressing "unused variable" because of the "catch" block
- Parameters
-
array | $names | |
bool | $softComparison | @SuppressWarnings(PHPMD.UnusedLocalVariable) |
Definition at line 100 of file ClassesTest.php.
106 foreach ($names as
$name) {
108 if ($softComparison) {
109 $this->assertNotRegExp(
'/\//',
$name);
111 $this->assertFalse(
false === strpos(
$name,
'_'));
112 $this->assertRegExp(
'/^([A-Z][A-Za-z\d_]+)+$/',
$name);
114 if (strpos(
$name,
'Magento') ===
false) {
117 $this->assertFalse(
false === strpos(
$name,
'\\'));
118 $this->assertRegExp(
'/^([A-Z\\\\][A-Za-z\d\\\\]+)+$/',
$name);
120 }
catch (\PHPUnit\Framework\AssertionFailedError $e) {
121 $factoryNames[] =
$name;
125 $this->fail(
"Obsolete factory name(s) detected in {$file}:" .
"\n" . implode(
"\n", $factoryNames));
elseif(isset( $params[ 'redirect_parent']))
if(!isset($_GET['name'])) $name
◆ testConfiguration()
- Parameters
-
Definition at line 38 of file ClassesTest.php.
40 $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this);
46 $xml = simplexml_load_file(
$path);
static collectClassesInConfig(\SimpleXMLElement $xml)
static getXmlAttributeValues(\SimpleXMLElement $xml, $xPath, $attributeName)
_assertNonFactoryName($names, $file, $softComparison=false, $moduleBlock=false)
◆ testLayouts()
- Parameters
-
Definition at line 58 of file ClassesTest.php.
60 $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this);
66 $xml = simplexml_load_file(
$path);
68 foreach (\
Magento\Framework\
App\Utility\Classes::getXmlAttributeValues(
75 $classes = array_merge(
77 \
Magento\Framework\
App\Utility\Classes::getXmlAttributeValues($xml,
'/layout//@module',
'module')
83 '/layout//action[@method="addTab"]/block'
static getCallbackClass($callbackName)
static collectLayoutClasses(\SimpleXMLElement $xml)
$_option $_optionId $class
_assertNonFactoryName($names, $file, $softComparison=false, $moduleBlock=false)
static getXmlNodeValues(\SimpleXMLElement $xml, $xPath)
◆ testPhpCode()
- Parameters
-
Definition at line 16 of file ClassesTest.php.
18 $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this);
static collectPhpCodeClasses($contents, &$classes=[])
const INCLUDE_NON_CLASSES
_assertNonFactoryName($names, $file, $softComparison=false, $moduleBlock=false)
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/static/testsuite/Magento/Test/Legacy/ClassesTest.php