This commit is contained in:
2026-09-15 10:26:34 +08:00
commit ecf36afa56
10493 changed files with 1404888 additions and 0 deletions
@@ -0,0 +1,40 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\TestFramework\Assert;
use PHPUnit\Framework\Assert;
/**
* Check that actual data contains all values from expected data
* But actual data can have more values than expected data
*/
class AssertArrayContains
{
/**
* @param array $expected
* @param array $actual
* @return void
*/
public static function assert(array $expected, array $actual)
{
foreach ($expected as $key => $value) {
Assert::assertArrayHasKey(
$key,
$actual,
"Expected value for key '{$key}' is missed"
);
if (is_array($value)) {
self::assert($value, $actual[$key]);
} else {
Assert::assertEquals(
$value,
$actual[$key],
"Expected value for key '{$key}' doesn't match"
);
}
}
}
}