Skip to content
Merged
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
78 changes: 39 additions & 39 deletions tests/Helper/ProfileValidatorTest.php
Comment thread
dati18 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -24,46 +24,46 @@ public function testProfileValidatorWorksWithInvalidProfile($profile): void {
$this->assertFalse($validator->passes());
}

public static function validProfileProvider() {
return [
['boring profile with no other' => [
'purpose' => 'data_hub',
'audience' => 'narrow',
'temporality' => 'permanent',
]],
['with other values' => [
'purpose' => 'data_hub',
'audience' => 'other',
'audience_other' => 'my cat',
'temporality' => 'other',
'temporality_other' => 'only in the past',
]],
];
public static function validProfileProvider(): iterable {
yield 'boring profile with no other' => [[
'purpose' => 'data_hub',
'audience' => 'narrow',
'temporality' => 'permanent',
]];

yield 'with other values' => [[
'purpose' => 'data_hub',
'audience' => 'other',
'audience_other' => 'my cat',
'temporality' => 'other',
'temporality_other' => 'only in the past',
]];
}

public static function invalidProfileProvider() {
return [
['missing other keys' => [
'purpose' => 'data_hub',
'audience' => 'narrow',
'temporality' => 'other',
]],
['audience is empty string' => [
'purpose' => 'data_hub',
'audience' => '',
'temporality' => 'other',
]],
['audience key present when purpose not data_hub' => [
'purpose' => 'data_lab',
'audience' => 'narrow',
'temporality' => 'permanent',
]],
['other keys when there should not be' => [
'purpose' => 'data_hub',
'purpose_other' => 'asdfasdf',
'audience' => 'narrow',
'temporality' => 'permanent',
]],
];
public static function invalidProfileProvider(): iterable {
yield 'missing other keys' => [[
'purpose' => 'data_hub',
'audience' => 'narrow',
'temporality' => 'other',
]];

yield 'audience is empty string' => [[
'purpose' => 'data_hub',
'audience' => '',
'temporality' => 'other',
]];

yield 'audience key present when purpose not data_hub' => [[
'purpose' => 'data_lab',
'audience' => 'narrow',
'temporality' => 'permanent',
]];

yield 'other keys when there should not be' => [[
'purpose' => 'data_hub',
'purpose_other' => 'asdfasdf',
'audience' => 'narrow',
'temporality' => 'permanent',
]];
}
}
Loading