1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- use PHPUnit\Framework\Assert;
- trait ContactsMenu {
-
-
-
- public function searchingForContactsMatchingWith(string $filter) {
- $url = '/index.php/contactsmenu/contacts';
- $parameters[] = 'filter=' . $filter;
- $url .= '?' . implode('&', $parameters);
- $this->sendingAToWithRequesttoken('POST', $url);
- }
-
- public function theListOfSearchedContactsHasContacts(int $count) {
- $this->theHTTPStatusCodeShouldBe(200);
- $searchedContacts = json_decode($this->response->getBody(), $asAssociativeArray = true)['contacts'];
- Assert::assertEquals($count, count($searchedContacts));
- }
-
- public function searchedContactXIsNamed(int $index, string $expectedName) {
- $searchedContacts = json_decode($this->response->getBody(), $asAssociativeArray = true)['contacts'];
- $searchedContact = $searchedContacts[$index];
- Assert::assertEquals($expectedName, $searchedContact['fullName']);
- }
- }
|