@@ -77,6 +77,6 @@ |
||
| 77 | 77 | echo("You may want to view this in your browser with enabled JSON Formatter or with REST API Client: $url"); |
| 78 | 78 | |
| 79 | 79 | return Request::get($url) |
| 80 | - ->send()->body; |
|
| 80 | + ->send()->body; |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | \ No newline at end of file |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | $template = Request::init() |
| 29 | 29 | ->withStrictSSL() |
| 30 | 30 | ->addHeader('Authorization', 'token') |
| 31 | - ->addHeader('User-Agent', 'Qualia API/PHP/'. PHP_VERSION . ' (' . PHP_OS . ')') |
|
| 31 | + ->addHeader('User-Agent', 'Qualia API/PHP/' . PHP_VERSION . ' (' . PHP_OS . ')') |
|
| 32 | 32 | ->parseWith(function($body) { |
| 33 | 33 | return json_decode($body, true); |
| 34 | 34 | }) |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | public function date($id, $date) |
| 105 | 105 | { |
| 106 | - if (! Util::isValidDate($date)) { |
|
| 106 | + if (!Util::isValidDate($date)) { |
|
| 107 | 107 | throw new InvalidArgumentException("Date must be provided in Y-m-d format"); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $this->additional['mark_complete'] = 1; |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - return $this->client->post('survey/'. $this->client->getSurveyId() .'/entries', $this->data, $this->additional); |
|
| 153 | + return $this->client->post('survey/' . $this->client->getSurveyId() . '/entries', $this->data, $this->additional); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | } |
| 157 | 157 | \ No newline at end of file |
@@ -1,4 +1,4 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require __DIR__.'/TestCase.php'; |
|
| 4 | -require __DIR__.'/../vendor/autoload.php'; |
|
| 3 | +require __DIR__ . '/TestCase.php'; |
|
| 4 | +require __DIR__ . '/../vendor/autoload.php'; |
|
@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | self::expectException("\\Qualia\\Exceptions\\RequestException"); |
| 13 | 13 | |
| 14 | 14 | Entry::build(new Client('597768e728d8f1508f6d9f62', 'invalid-credentials')) |
| 15 | - ->email('q_tVabQ3cUlwZTgQ10', '[email protected]') |
|
| 16 | - ->send(); |
|
| 15 | + ->email('q_tVabQ3cUlwZTgQ10', '[email protected]') |
|
| 16 | + ->send(); |
|
| 17 | 17 | |
| 18 | 18 | } |
| 19 | 19 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | self::expectException("InvalidArgumentException"); |
| 23 | 23 | |
| 24 | 24 | Entry::build($this->client) |
| 25 | - ->send(); |
|
| 25 | + ->send(); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | public function allowsOnlyCorrectDateNotUnixTime() |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | $id = uniqid('', true); |
| 33 | 33 | |
| 34 | 34 | Entry::build($this->client) |
| 35 | - ->uniqueId($id) |
|
| 36 | - ->date('q_1J75WdyBwVpwlJUM', time()) |
|
| 37 | - ->send(); |
|
| 35 | + ->uniqueId($id) |
|
| 36 | + ->date('q_1J75WdyBwVpwlJUM', time()) |
|
| 37 | + ->send(); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function allowsOnlyCorrectDate() |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | self::expectException("InvalidArgumentException"); |
| 43 | 43 | |
| 44 | 44 | Entry::build($this->client) |
| 45 | - ->date('q_1J75WdyBwVpwlJUM', 'invalid') |
|
| 46 | - ->send(); |
|
| 45 | + ->date('q_1J75WdyBwVpwlJUM', 'invalid') |
|
| 46 | + ->send(); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | public function testCreatesEntryWithEmail() |
@@ -51,9 +51,9 @@ discard block |
||
| 51 | 51 | $id = uniqid('', true); |
| 52 | 52 | |
| 53 | 53 | $response = Entry::build($this->client) |
| 54 | - ->uniqueId($id) |
|
| 55 | - ->email('q_3RYJ4MpggyMFuU50', $id."[email protected]") |
|
| 56 | - ->send(); |
|
| 54 | + ->uniqueId($id) |
|
| 55 | + ->email('q_3RYJ4MpggyMFuU50', $id."[email protected]") |
|
| 56 | + ->send(); |
|
| 57 | 57 | |
| 58 | 58 | self::assertEquals('success', $response['message']); |
| 59 | 59 | self::assertArrayHasKey('id', $response); |
@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | $id = uniqid('', true); |
| 65 | 65 | |
| 66 | 66 | $response = Entry::build($this->client) |
| 67 | - ->email('q_3RYJ4MpggyMFuU50', $id."[email protected]") |
|
| 68 | - ->response('q_tVabQ3cUlwZTgQ10', 'o_ACvo61cUuKXxD5C1') |
|
| 69 | - ->send(); |
|
| 67 | + ->email('q_3RYJ4MpggyMFuU50', $id."[email protected]") |
|
| 68 | + ->response('q_tVabQ3cUlwZTgQ10', 'o_ACvo61cUuKXxD5C1') |
|
| 69 | + ->send(); |
|
| 70 | 70 | |
| 71 | 71 | self::assertEquals('success', $response['message']); |
| 72 | 72 | self::assertArrayHasKey('id', $response); |
@@ -77,12 +77,12 @@ discard block |
||
| 77 | 77 | $id = uniqid('', true); |
| 78 | 78 | |
| 79 | 79 | $response = Entry::build($this->client) |
| 80 | - ->uniqueId($id) |
|
| 81 | - ->email('q_3RYJ4MpggyMFuU50', $id."[email protected]") |
|
| 82 | - ->name('q_KCyzOs7VqevWbEO0', "Unit", "Tester") |
|
| 83 | - ->date('q_1J75WdyBwVpwlJUM', date('Y-m-d')) |
|
| 84 | - ->response('q_KCyzOs7VqevWbEO0', ['o_wCcuY5a54YBeXLC1', 'o_ACvo61cUuKXxD5C1']) |
|
| 85 | - ->send(); |
|
| 80 | + ->uniqueId($id) |
|
| 81 | + ->email('q_3RYJ4MpggyMFuU50', $id."[email protected]") |
|
| 82 | + ->name('q_KCyzOs7VqevWbEO0', "Unit", "Tester") |
|
| 83 | + ->date('q_1J75WdyBwVpwlJUM', date('Y-m-d')) |
|
| 84 | + ->response('q_KCyzOs7VqevWbEO0', ['o_wCcuY5a54YBeXLC1', 'o_ACvo61cUuKXxD5C1']) |
|
| 85 | + ->send(); |
|
| 86 | 86 | |
| 87 | 87 | self::assertEquals('success', $response['message']); |
| 88 | 88 | self::assertArrayHasKey('id', $response); |
@@ -93,9 +93,9 @@ discard block |
||
| 93 | 93 | $id = uniqid('', true); |
| 94 | 94 | |
| 95 | 95 | $response = Entry::build($this->client) |
| 96 | - ->uniqueId($id) |
|
| 97 | - ->email('q_3RYJ4MpggyMFuU50', $id."[email protected]") |
|
| 98 | - ->send(true); |
|
| 96 | + ->uniqueId($id) |
|
| 97 | + ->email('q_3RYJ4MpggyMFuU50', $id."[email protected]") |
|
| 98 | + ->send(true); |
|
| 99 | 99 | |
| 100 | 100 | self::assertEquals('success', $response['message']); |
| 101 | 101 | self::assertArrayHasKey('id', $response); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | $response = Entry::build($this->client) |
| 54 | 54 | ->uniqueId($id) |
| 55 | - ->email('q_3RYJ4MpggyMFuU50', $id."[email protected]") |
|
| 55 | + ->email('q_3RYJ4MpggyMFuU50', $id . "[email protected]") |
|
| 56 | 56 | ->send(); |
| 57 | 57 | |
| 58 | 58 | self::assertEquals('success', $response['message']); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $id = uniqid('', true); |
| 65 | 65 | |
| 66 | 66 | $response = Entry::build($this->client) |
| 67 | - ->email('q_3RYJ4MpggyMFuU50', $id."[email protected]") |
|
| 67 | + ->email('q_3RYJ4MpggyMFuU50', $id . "[email protected]") |
|
| 68 | 68 | ->response('q_tVabQ3cUlwZTgQ10', 'o_ACvo61cUuKXxD5C1') |
| 69 | 69 | ->send(); |
| 70 | 70 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $response = Entry::build($this->client) |
| 80 | 80 | ->uniqueId($id) |
| 81 | - ->email('q_3RYJ4MpggyMFuU50', $id."[email protected]") |
|
| 81 | + ->email('q_3RYJ4MpggyMFuU50', $id . "[email protected]") |
|
| 82 | 82 | ->name('q_KCyzOs7VqevWbEO0', "Unit", "Tester") |
| 83 | 83 | ->date('q_1J75WdyBwVpwlJUM', date('Y-m-d')) |
| 84 | 84 | ->response('q_KCyzOs7VqevWbEO0', ['o_wCcuY5a54YBeXLC1', 'o_ACvo61cUuKXxD5C1']) |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | $response = Entry::build($this->client) |
| 96 | 96 | ->uniqueId($id) |
| 97 | - ->email('q_3RYJ4MpggyMFuU50', $id."[email protected]") |
|
| 97 | + ->email('q_3RYJ4MpggyMFuU50', $id . "[email protected]") |
|
| 98 | 98 | ->send(true); |
| 99 | 99 | |
| 100 | 100 | self::assertEquals('success', $response['message']); |