diff --git a/behat.yml.dist b/behat.yml.dist index 121fd48..993e467 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -16,3 +16,4 @@ default: 'Population data': 'table.countries' 'Employees': '.employees > table' 'Mad spanner': '.madspans' + 'User roles': '.roles' diff --git a/features/tables.feature b/features/tables.feature index 077b09e..cd2797b 100644 --- a/features/tables.feature +++ b/features/tables.feature @@ -6,7 +6,7 @@ Feature: Inspecting HTML tables Scenario: Check if any table on the page matches certain characteristics Given I am on the homepage Then I should see a table - And I should see 5 tables + And I should see 6 tables And I should see a table with 2 columns And I should see a table with 3 columns @@ -147,3 +147,16 @@ Feature: Inspecting HTML tables | | | 3C | | | | | 4A | 4B | | 4D | | | | 5A | | 5C | | | | + + # The sixth table contains cells with the same content in different rows. + And I should see the "User roles" table + And the "User roles" table should have 3 columns + And the "User roles" table should have 7 rows + And the "User roles" table should contain the following columns: + | Group | Username | Role | + | Engineering | Najib Randall | administrator | + | Support | Victor Otto | administrator | + | Engineering | Melor Vescovi | moderator | + | Engineering | Panteleimon Kita | moderator | + | Support | Victor Otto | moderator | + | Support | Melissa Kevorkian | moderator | diff --git a/fixtures/index.html b/fixtures/index.html index 2427546..b73a4cc 100644 --- a/fixtures/index.html +++ b/fixtures/index.html @@ -183,5 +183,46 @@ 5C + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GroupUsernameRole
EngineeringNajib Randalladministrator
SupportVictor Ottoadministrator
EngineeringMelor Vescovimoderator
SupportVictor Ottomoderator
EngineeringPanteleimon Kitamoderator
SupportMelissa Kevorkianmoderator
diff --git a/src/AssertArraySubset.php b/src/AssertArraySubset.php index e8fb6bd..c85dd28 100644 --- a/src/AssertArraySubset.php +++ b/src/AssertArraySubset.php @@ -132,6 +132,7 @@ private function arrayIntersectRecursive(array $array, array $subset): array } } - return $intersect; + // Only return the result if it fully matches the subset. + return count($subset) == count($intersect) ? $intersect : []; } }