Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit ff75895

Browse files
committed
Better assertion for required message
- In each case, this should be the only message; use `assertSame()`.
1 parent ff81186 commit ff75895

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

test/InputTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,12 @@ public function assertRequiredValidationErrorMessage($input, $message = '')
4242

4343
$messages = $input->getMessages();
4444
$this->assertInternalType('array', $messages, $message . ' non-array messages array');
45-
$this->assertArrayHasKey(NotEmpty::IS_EMPTY, $messages, $message . ' missing NotEmpty::IS_EMPTY key');
4645

4746
$notEmpty = new NotEmpty();
4847
$messageTemplates = $notEmpty->getOption('messageTemplates');
49-
$this->assertEquals(
50-
$messageTemplates[NotEmpty::IS_EMPTY],
51-
$messages[NotEmpty::IS_EMPTY],
52-
$message . ' NotEmpty::IS_EMPTY message differs'
53-
);
48+
$this->assertSame([
49+
NotEmpty::IS_EMPTY => $messageTemplates[NotEmpty::IS_EMPTY],
50+
], $messages, $message . ' missing NotEmpty::IS_EMPTY key and/or contains additional messages');
5451
}
5552

5653
public function testConstructorRequiresAName()

0 commit comments

Comments
 (0)