Skip to content

Commit 26251f0

Browse files
authored
Merge branch 'develop' into MQE-884
2 parents b71431b + 15d7407 commit 26251f0

File tree

62 files changed

+898
-53
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+898
-53
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
"squizlabs/php_codesniffer": "1.5.3",
2525
"sebastian/phpcpd": "~3.0",
2626
"brainmaestro/composer-git-hooks": "^2.3",
27-
"codeception/aspect-mock": "^2.0",
28-
"goaop/framework": "2.1.2",
27+
"doctrine/cache": "<1.7.0",
28+
"codeception/aspect-mock": "^3.0",
29+
"goaop/framework": "2.2.0",
2930
"codacy/coverage": "^1.4",
3031
"phpmd/phpmd": "^2.6.0",
3132
"rregeer/phpunit-coverage-check": "^0.1.4",

composer.lock

Lines changed: 99 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/.cache/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Ignore everything in this directory
2+
*
3+
# Except this file
4+
!.gitignore

dev/tests/_bootstrap.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@
1313
$kernel = \AspectMock\Kernel::getInstance();
1414
$kernel->init([
1515
'debug' => true,
16-
'includePaths' => [PROJECT_ROOT . '/src']
16+
'includePaths' => [PROJECT_ROOT . '/src'],
17+
'cacheDir' => PROJECT_ROOT .
18+
DIRECTORY_SEPARATOR .
19+
'dev' .
20+
DIRECTORY_SEPARATOR .
21+
'tests' .
22+
DIRECTORY_SEPARATOR .
23+
'.cache'
1724
]);
1825

1926
// set mftf appplication context

dev/tests/unit/Magento/FunctionalTestFramework/Test/Handlers/TestObjectHandlerTest.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public function testGetTestObject()
8888
$testDataArrayBuilder->testName,
8989
[$expectedTestActionObject],
9090
[
91+
'features' => ['NO MODULE DETECTED'],
9192
'group' => ['test']
9293
],
9394
[
@@ -101,6 +102,15 @@ public function testGetTestObject()
101102
$this->assertEquals($expectedTestObject, $actualTestObject);
102103
}
103104

105+
/**
106+
* Tests basic getting of a test that has a fileName
107+
*/
108+
public function testGetTestWithFileName()
109+
{
110+
$this->markTestIncomplete();
111+
//TODO
112+
}
113+
104114
/**
105115
* Tests the function used to get a series of relevant tests by group.
106116
*
@@ -131,6 +141,44 @@ public function testGetTestsByGroup()
131141
$this->assertArrayNotHasKey('excludeTest', $tests);
132142
}
133143

144+
/**
145+
* Tests the function used to parse and determine a test's Module (used in allure Features annotation)
146+
*
147+
* @throws \Exception
148+
*/
149+
public function testGetTestWithModuleName()
150+
{
151+
// set up Test Data
152+
$moduleExpected = "SomeTestModule";
153+
$filepath = DIRECTORY_SEPARATOR .
154+
"user" .
155+
"magento2ce" . DIRECTORY_SEPARATOR .
156+
"dev" . DIRECTORY_SEPARATOR .
157+
"tests" . DIRECTORY_SEPARATOR .
158+
"acceptance" . DIRECTORY_SEPARATOR .
159+
"tests" . DIRECTORY_SEPARATOR .
160+
$moduleExpected . DIRECTORY_SEPARATOR .
161+
"Tests" . DIRECTORY_SEPARATOR .
162+
"text.xml";
163+
// set up mock data
164+
$testDataArrayBuilder = new TestDataArrayBuilder();
165+
$mockData = $testDataArrayBuilder
166+
->withAnnotations()
167+
->withFailedHook()
168+
->withAfterHook()
169+
->withBeforeHook()
170+
->withTestActions()
171+
->withFileName($filepath)
172+
->build();
173+
$this->setMockParserOutput(['tests' => $mockData]);
174+
// Execute Test Method
175+
$toh = TestObjectHandler::getInstance();
176+
$actualTestObject = $toh->getObject($testDataArrayBuilder->testName);
177+
$moduleName = $actualTestObject->getAnnotations()["features"][0];
178+
//performAsserts
179+
$this->assertEquals($moduleExpected, $moduleName);
180+
}
181+
134182
/**
135183
* Function used to set mock for parser return and force init method to run between tests.
136184
*

0 commit comments

Comments
 (0)