Skip to content

Add Functional Test reference file #411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,23 @@ public function testGetLinkedEntities()
$this->assertEquals("linkedEntity2", $dataObject->getLinkedEntitiesOfType("otherEntityType")[0]);
}

public function testGetCamelCaseKeys()
{
$data = [
"lowercasekey1" => "value1",
"camelCaseKey2" => "value2",
"lowercasekey3" => "value3",
"camelCaseKey4" => "value4"
];

$dataObject = new EntityDataObject("name", "type", $data, null, null, null);

$this->assertEquals("value1", $dataObject->getDataByName("lowercasekey1", 0));
$this->assertEquals("value2", $dataObject->getDataByName("camelCaseKey2", 0));
$this->assertEquals("value3", $dataObject->getDataByName("lowercasekey3", 0));
$this->assertEquals("value4", $dataObject->getDataByName("camelCaseKey4", 0));
}

/**
* After class functionality
* @return void
Expand Down
15 changes: 6 additions & 9 deletions docs/mftf-tests.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
---
layout: full-width
title: MFTF Tests
---
<style>
.mftf-dl {
margin-bottom: 2.5em;
}
dl dt{
font-weight:500;
}
.mftf-test-link {
font-weight: normal;
font-weight:400;
}

</style>

# MFTF functional test reference

The Magento Functional Testing Framework runs tests on every Module within Magento. These files are stored within each Module folder in the Magento repo.
This page lists all those tests so that developers can have a good sense of what is covered.

{% assign mftf = site.data.mftf | group_by: "module" | sort: "name" %}
{% include mftf/mftf_data.md %}

{% for item in mftf %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,22 @@ public function getDataByName($name, $uniquenessFormat)

$name_lower = strtolower($name);

if ($this->data !== null && array_key_exists($name_lower, $this->data)) {
if ($this->data === null) {
return null;
}

if (array_key_exists($name_lower, $this->data)) {
$uniquenessData = $this->getUniquenessDataByName($name_lower);
if (null === $uniquenessData || $uniquenessFormat == self::NO_UNIQUE_PROCESS) {
return $this->data[$name_lower];
}
return $this->formatUniqueData($name_lower, $uniquenessData, $uniquenessFormat);
} elseif (array_key_exists($name, $this->data)) {
// Data returned by the API may be camelCase so we need to check for the original $name also.
return $this->data[$name];
} else {
return null;
}

return null;
}

/**
Expand Down