Skip to content

Commit df8ee73

Browse files
committed
Improved Yaml Test + added skip tests
1 parent 6f07f27 commit df8ee73

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

util/ActionTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ private function do(array $actions): string
9999
];
100100
foreach ($actions as $key => $value) {
101101
if (method_exists($this, $key)) {
102+
if (empty($value)) {
103+
printf("Empty: %s, %s\n", $key, var_export($actions, true));
104+
exit(1);
105+
}
102106
$this->$key($value, $vars);
103107
} else {
104108
// headers
@@ -286,6 +290,8 @@ private function match(array $actions)
286290
($this->phpUnitVersion > 8) ? (self::TEMPLATE_PHPUNIT9_MATCH_REGEX) : (self::TEMPLATE_MATCH_REGEX),
287291
$vars
288292
);
293+
} elseif (is_string($expected) && substr($expected,0,5) === '$body') {
294+
$vars[':expected'] = $this->convertResponseField($expected);
289295
} elseif (is_array($expected)) {
290296
if ($vars[':value'] === '$response') {
291297
$vars[':value'] = '$response->asArray()';

util/YamlTests.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,16 @@ class YamlTests
5252
'Cat\Templates\_10_BasicTest::FilteredTemplates' => 'regex mismatch',
5353
'Cat\Templates\_10_BasicTest::SelectColumns' => 'regex mismatch',
5454
'FieldCaps\_50_Fieldtype_FilterTest::*' => 'Bool mismatch',
55+
'Indices\Create\_20_Synthetic_SourceTest::*' => 'Undefined array key',
56+
'Indices\Create\_21_Synthetic_Source_StoredTest::*' => 'Undefined array key',
5557
'Indices\GetAlias\_10_BasicTest::GetAliasAgainstClosedIndices' => 'Failed asserting that true is false',
5658
'Indices\GetIndexTemplate\_10_BasicTest::*' => 'Bool mismatch',
5759
'Indices\PutTemplate\_10_BasicTest::PutTemplateCreate' => 'index_template [test] already exists',
60+
'Indices\Recovery\_20_Synthetic_SourceTest::TestRecoveryEmptyIndexWithUse_synthetic_source' => 'bad request',
5861
'Indices\Refresh\_10_BasicTest::IndicesRefreshTestEmptyArray' => 'empty array?',
5962
'Indices\ResolveCluster\_10_Basic_Resolve_ClusterTest::TestResolveClusterOptionalParamsAreAccepted' => 'Bool mismatch',
6063
'Indices\SimulateIndexTemplate\_10_BasicTest::SimulateIndexTemplateWithIndexNotMatchingAnyTemplate' => 'Bool mismatch',
64+
'IngestGeoip\_20_Geoip_ProcessorTest::*' => 'Undefined array key',
6165
'Search\Vectors\_90_Sparse_VectorTest::SparseVectorIn800X8110' => 'Undefined array key error',
6266
'Snapshot\Create\_10_BasicTest::CreateASnapshot' => 'Invalid snapshot name [test_snapshot]',
6367
'Snapshot\Create\_10_BasicTest::CreateASnapshotAndCleanUpRepository' => 'Invalid snapshot name [test_snapshot]',

0 commit comments

Comments
 (0)