@@ -149,7 +149,7 @@ |
||
149 | 149 | |
150 | 150 | /** |
151 | 151 | * @param \ReflectionMethod $refMethod |
152 | - * @return array |
|
152 | + * @return string |
|
153 | 153 | */ |
154 | 154 | protected function getParamsString(\ReflectionMethod $refMethod) |
155 | 155 | { |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | $params = []; |
100 | 100 | foreach ($refMethod->getParameters() as $param) { |
101 | 101 | if ($param->isOptional()) { |
102 | - $params[] = '$' . $param->name . ' = '.$this->getDefaultValue($param); |
|
102 | + $params[] = '$'.$param->name.' = '.$this->getDefaultValue($param); |
|
103 | 103 | } else { |
104 | - $params[] = '$' . $param->name; |
|
104 | + $params[] = '$'.$param->name; |
|
105 | 105 | }; |
106 | 106 | } |
107 | 107 | return implode(', ', $params); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | private function phpEncodeArray(array $array) |
176 | 176 | { |
177 | - $isPlainArray = function (array $value) { |
|
177 | + $isPlainArray = function(array $value) { |
|
178 | 178 | return ((count($value) === 0) |
179 | 179 | || ( |
180 | 180 | (array_keys($value) === range(0, count($value) - 1)) |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | return '['.implode(', ', array_map([$this, 'phpEncodeValue'], $array)).']'; |
187 | 187 | } |
188 | 188 | |
189 | - return '['.implode(', ', array_map(function ($key) use ($array) { |
|
189 | + return '['.implode(', ', array_map(function($key) use ($array) { |
|
190 | 190 | return $this->phpEncodeValue($key).' => '.$this->phpEncodeValue($array[$key]); |
191 | 191 | }, array_keys($array))).']'; |
192 | 192 | } |
@@ -311,7 +311,7 @@ |
||
311 | 311 | * |
312 | 312 | * @param $qb |
313 | 313 | * @param $assoc |
314 | - * @param $alias |
|
314 | + * @param string $alias |
|
315 | 315 | * @param $params |
316 | 316 | */ |
317 | 317 | protected function buildAssociationQuery($qb, $assoc, $alias, $params) |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | $this->debug($qb->getDQL()); |
363 | 363 | $res = $qb->getQuery()->getArrayResult(); |
364 | 364 | |
365 | - return ['True', (count($res) > 0), "$entity with " . json_encode($params)]; |
|
365 | + return ['True', (count($res) > 0), "$entity with ".json_encode($params)]; |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | /** |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | $this->em->flush(); |
391 | 391 | $data = $this->em->getClassMetadata($entity); |
392 | 392 | $qb = $this->em->getRepository($entity)->createQueryBuilder('s'); |
393 | - $qb->select('s.' . $field); |
|
393 | + $qb->select('s.'.$field); |
|
394 | 394 | $this->buildAssociationQuery($qb, $entity, 's', $params); |
395 | 395 | $this->debug($qb->getDQL()); |
396 | 396 | return $qb->getQuery()->getSingleScalarResult(); |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | $this->buildAssociationQuery($qb, $map['targetEntity'], $column, $v); |
418 | 418 | continue; |
419 | 419 | } |
420 | - $paramname = "_$key" . '__' . $column; |
|
420 | + $paramname = "_$key".'__'.$column; |
|
421 | 421 | $qb->andWhere("_$key.$column = :$paramname"); |
422 | 422 | $qb->setParameter($paramname, $v); |
423 | 423 | } |
@@ -32,6 +32,9 @@ |
||
32 | 32 | $this->runHooks('afterClass'); |
33 | 33 | } |
34 | 34 | |
35 | + /** |
|
36 | + * @param string $hookName |
|
37 | + */ |
|
35 | 38 | protected function runHooks($hookName) |
36 | 39 | { |
37 | 40 | foreach ($this->hooks as $className => $hook) { |
@@ -113,6 +113,9 @@ |
||
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
116 | + /** |
|
117 | + * @param \Codeception\SuiteManager $suiteManager |
|
118 | + */ |
|
116 | 119 | protected function getTests($suiteManager) |
117 | 120 | { |
118 | 121 | $suiteManager->loadTests(); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | $path = $input->getOption('path') |
50 | 50 | ? $input->getOption('path') |
51 | - : Configuration::dataDir() . 'scenarios'; |
|
51 | + : Configuration::dataDir().'scenarios'; |
|
52 | 52 | |
53 | 53 | $format = $input->getOption('format'); |
54 | 54 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | ); |
61 | 61 | } |
62 | 62 | |
63 | - $path = $path . DIRECTORY_SEPARATOR . $suite; |
|
63 | + $path = $path.DIRECTORY_SEPARATOR.$suite; |
|
64 | 64 | if (!$input->getOption('single-file')) { |
65 | 65 | @mkdir($path); |
66 | 66 | } |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | $suiteManager = new \Codeception\SuiteManager(new EventDispatcher(), $suite, $suiteConf); |
69 | 69 | |
70 | 70 | if ($suiteConf['bootstrap']) { |
71 | - if (file_exists($suiteConf['path'] . $suiteConf['bootstrap'])) { |
|
72 | - require_once $suiteConf['path'] . $suiteConf['bootstrap']; |
|
71 | + if (file_exists($suiteConf['path'].$suiteConf['bootstrap'])) { |
|
72 | + require_once $suiteConf['path'].$suiteConf['bootstrap']; |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | // create separate file for each test in Cest |
88 | 88 | if ($test instanceof Cest && !$input->getOption('single-file')) { |
89 | - $name .= '.' . $this->underscore($test->getTestMethod()); |
|
89 | + $name .= '.'.$this->underscore($test->getTestMethod()); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | if ($input->getOption('single-file')) { |
@@ -94,13 +94,13 @@ discard block |
||
94 | 94 | $output->writeln("* $name rendered"); |
95 | 95 | } else { |
96 | 96 | $feature = $this->decorate($feature, $format); |
97 | - $this->createFile($path . DIRECTORY_SEPARATOR . $name . $this->formatExtension($format), $feature, true); |
|
97 | + $this->createFile($path.DIRECTORY_SEPARATOR.$name.$this->formatExtension($format), $feature, true); |
|
98 | 98 | $output->writeln("* $name generated"); |
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
102 | 102 | if ($input->getOption('single-file')) { |
103 | - $this->createFile($path . $this->formatExtension($format), $this->decorate($scenarios, $format), true); |
|
103 | + $this->createFile($path.$this->formatExtension($format), $this->decorate($scenarios, $format), true); |
|
104 | 104 | } |
105 | 105 | } |
106 | 106 |
@@ -7,7 +7,6 @@ |
||
7 | 7 | use GuzzleHttp\Post\PostFile; |
8 | 8 | use Symfony\Component\BrowserKit\Client; |
9 | 9 | use Symfony\Component\BrowserKit\Response as BrowserKitResponse; |
10 | -use GuzzleHttp\Url; |
|
11 | 10 | use Symfony\Component\BrowserKit\Request as BrowserKitRequest; |
12 | 11 | |
13 | 12 | class Guzzle extends Client |
@@ -106,7 +106,7 @@ |
||
106 | 106 | if (strpos($contentType, 'charset=') === false) { |
107 | 107 | $body = $response->getBody(true); |
108 | 108 | if (preg_match('/\<meta[^\>]+charset *= *["\']?([a-zA-Z\-0-9]+)/i', $body, $matches)) { |
109 | - $contentType .= ';charset=' . $matches[1]; |
|
109 | + $contentType .= ';charset='.$matches[1]; |
|
110 | 110 | } |
111 | 111 | $response->setHeader('Content-Type', $contentType); |
112 | 112 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | /** |
92 | 92 | * Taken from Mink\BrowserKitDriver |
93 | 93 | * |
94 | - * @param Response $response |
|
94 | + * @param \Psr\Http\Message\ResponseInterface|null $response |
|
95 | 95 | * |
96 | 96 | * @return \Symfony\Component\BrowserKit\Response |
97 | 97 | */ |
@@ -151,6 +151,9 @@ discard block |
||
151 | 151 | return new BrowserKitResponse($response->getBody(), $status, $headers); |
152 | 152 | } |
153 | 153 | |
154 | + /** |
|
155 | + * @param string $uri |
|
156 | + */ |
|
154 | 157 | public function getAbsoluteUri($uri) |
155 | 158 | { |
156 | 159 | $baseUri = $this->baseUri; |
@@ -85,6 +85,9 @@ discard block |
||
85 | 85 | $this->executeFacebookRequest('DELETE', '/' . $testUserID); |
86 | 86 | } |
87 | 87 | |
88 | + /** |
|
89 | + * @param string $testUserAccessToken |
|
90 | + */ |
|
88 | 91 | public function getTestUserInfo($testUserAccessToken) |
89 | 92 | { |
90 | 93 | $response = $this->executeFacebookRequest( |
@@ -97,6 +100,9 @@ discard block |
||
97 | 100 | return $response->getDecodedBody(); |
98 | 101 | } |
99 | 102 | |
103 | + /** |
|
104 | + * @param string $testUserAccessToken |
|
105 | + */ |
|
100 | 106 | public function getLastPostsForTestUser($testUserAccessToken) |
101 | 107 | { |
102 | 108 | $response = $this->executeFacebookRequest( |
@@ -109,6 +115,10 @@ discard block |
||
109 | 115 | return $response->getDecodedBody(); |
110 | 116 | } |
111 | 117 | |
118 | + /** |
|
119 | + * @param string $placeId |
|
120 | + * @param string $testUserAccessToken |
|
121 | + */ |
|
112 | 122 | public function getVisitedPlaceTagForTestUser($placeId, $testUserAccessToken) |
113 | 123 | { |
114 | 124 | $response = $this->executeFacebookRequest( |
@@ -121,6 +131,9 @@ discard block |
||
121 | 131 | return $response->getDecodedBody(); |
122 | 132 | } |
123 | 133 | |
134 | + /** |
|
135 | + * @param string $testUserAccessToken |
|
136 | + */ |
|
124 | 137 | public function sendPostToFacebook($testUserAccessToken, array $parameters) |
125 | 138 | { |
126 | 139 | $response = $this->executeFacebookRequest( |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | $this->appId = $config['app_id']; |
58 | 58 | $this->appSecret = $config['secret']; |
59 | - $this->appToken = $this->appId . '|' . $this->appSecret; |
|
59 | + $this->appToken = $this->appId.'|'.$this->appSecret; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | { |
70 | 70 | $response = $this->executeFacebookRequest( |
71 | 71 | 'POST', |
72 | - $this->appId . '/accounts/test-users', |
|
72 | + $this->appId.'/accounts/test-users', |
|
73 | 73 | [ |
74 | 74 | 'name' => $name, |
75 | 75 | 'installed' => true, |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | public function deleteTestUser($testUserID) |
84 | 84 | { |
85 | - $this->executeFacebookRequest('DELETE', '/' . $testUserID); |
|
85 | + $this->executeFacebookRequest('DELETE', '/'.$testUserID); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | public function getTestUserInfo($testUserAccessToken) |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $response = $this->fb->delete($endpoint, $parameters, $token); |
164 | 164 | break; |
165 | 165 | default: |
166 | - throw new \Exception("Facebook driver exception, please add support for method: " . $method); |
|
166 | + throw new \Exception("Facebook driver exception, please add support for method: ".$method); |
|
167 | 167 | break; |
168 | 168 | } |
169 | 169 |
@@ -149,7 +149,7 @@ |
||
149 | 149 | |
150 | 150 | /** |
151 | 151 | * @param \ReflectionMethod $refMethod |
152 | - * @return array |
|
152 | + * @return string |
|
153 | 153 | */ |
154 | 154 | protected function getParamsString(\ReflectionMethod $refMethod) |
155 | 155 | { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | return (new Template($this->template)) |
85 | - ->place('namespace', $namespace ? $namespace . '\\' : '') |
|
85 | + ->place('namespace', $namespace ? $namespace.'\\' : '') |
|
86 | 86 | ->place('hash', self::genHash($this->modules, $this->settings)) |
87 | 87 | ->place('name', $this->name) |
88 | 88 | ->place('methods', implode("\n\n ", $code)) |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $doc = "*"; |
104 | 104 | } |
105 | 105 | |
106 | - $conditionalDoc = $doc . "\n * Conditional Assertion: Test won't be stopped on fail"; |
|
106 | + $conditionalDoc = $doc."\n * Conditional Assertion: Test won't be stopped on fail"; |
|
107 | 107 | |
108 | 108 | $methodTemplate = (new Template($this->methodTemplate)) |
109 | 109 | ->place('module', $module) |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $type = 'Assertion'; |
116 | 116 | $body .= $methodTemplate |
117 | 117 | ->place('doc', $conditionalDoc) |
118 | - ->place('action', 'can' . ucfirst($refMethod->name)) |
|
118 | + ->place('action', 'can'.ucfirst($refMethod->name)) |
|
119 | 119 | ->place('step', 'ConditionalAssertion') |
120 | 120 | ->produce(); |
121 | 121 | |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | $params = []; |
152 | 152 | foreach ($refMethod->getParameters() as $param) { |
153 | 153 | if ($param->isOptional()) { |
154 | - $params[] = '$' . $param->name . ' = null'; |
|
154 | + $params[] = '$'.$param->name.' = null'; |
|
155 | 155 | } else { |
156 | - $params[] = '$' . $param->name; |
|
156 | + $params[] = '$'.$param->name; |
|
157 | 157 | }; |
158 | 158 | } |
159 | 159 | return implode(', ', $params); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $actions[$moduleName] = get_class_methods(get_class($module)); |
198 | 198 | } |
199 | 199 | |
200 | - return md5(Codecept::VERSION . serialize($actions) . serialize($settings['modules'])); |
|
200 | + return md5(Codecept::VERSION.serialize($actions).serialize($settings['modules'])); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | public function getNumMethods() |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
117 | - * @return array |
|
117 | + * @return string[] |
|
118 | 118 | */ |
119 | 119 | public function _parts() |
120 | 120 | { |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | * ?> |
554 | 554 | * ``` |
555 | 555 | * |
556 | - * @return bool |
|
556 | + * @return boolean|null |
|
557 | 557 | */ |
558 | 558 | public function seeFormHasErrors() |
559 | 559 | { |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | * ?> |
573 | 573 | * ``` |
574 | 574 | * |
575 | - * @return bool |
|
575 | + * @return boolean|null |
|
576 | 576 | */ |
577 | 577 | public function dontSeeFormErrors() |
578 | 578 | { |
@@ -953,7 +953,7 @@ discard block |
||
953 | 953 | * Returns a list of recognized domain names. |
954 | 954 | * This elements of this list are regular expressions. |
955 | 955 | * |
956 | - * @return array |
|
956 | + * @return string[] |
|
957 | 957 | */ |
958 | 958 | protected function getInternalDomains() |
959 | 959 | { |
@@ -402,7 +402,6 @@ |
||
402 | 402 | * $I->callArtisan('command:name', ['parameter' => 'value']); |
403 | 403 | * ?> |
404 | 404 | * ``` |
405 | - |
|
406 | 405 | * @param string $command |
407 | 406 | * @param array $parameters |
408 | 407 | */ |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | 'run_database_seeder' => false, |
129 | 129 | 'database_seeder_class' => '', |
130 | 130 | 'environment_file' => '.env', |
131 | - 'bootstrap' => 'bootstrap' . DIRECTORY_SEPARATOR . 'app.php', |
|
131 | + 'bootstrap' => 'bootstrap'.DIRECTORY_SEPARATOR.'app.php', |
|
132 | 132 | 'root' => '', |
133 | 133 | 'packages' => 'workbench', |
134 | 134 | 'vendor_dir' => 'vendor', |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $projectDir .= $this->config['root']; |
145 | 145 | |
146 | 146 | $this->config['project_dir'] = $projectDir; |
147 | - $this->config['bootstrap_file'] = $projectDir . $this->config['bootstrap']; |
|
147 | + $this->config['bootstrap_file'] = $projectDir.$this->config['bootstrap']; |
|
148 | 148 | |
149 | 149 | parent::__construct($container); |
150 | 150 | } |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | */ |
227 | 227 | private function applicationUsesDatabase() |
228 | 228 | { |
229 | - return ! empty($this->app['config']['database.default']); |
|
229 | + return !empty($this->app['config']['database.default']); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | /** |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | */ |
253 | 253 | protected function registerAutoloaders() |
254 | 254 | { |
255 | - require $this->config['project_dir'] . $this->config['vendor_dir'] . DIRECTORY_SEPARATOR . 'autoload.php'; |
|
255 | + require $this->config['project_dir'].$this->config['vendor_dir'].DIRECTORY_SEPARATOR.'autoload.php'; |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | /** |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | $rootNamespace = $this->getRootControllerNamespace(); |
562 | 562 | |
563 | 563 | if ($rootNamespace && !(strpos($action, '\\') === 0)) { |
564 | - return $rootNamespace . '\\' . $action; |
|
564 | + return $rootNamespace.'\\'.$action; |
|
565 | 565 | } |
566 | 566 | |
567 | 567 | return trim($action, '\\'); |
@@ -604,11 +604,11 @@ discard block |
||
604 | 604 | return; |
605 | 605 | } |
606 | 606 | |
607 | - if (! $this->app['session']->has($key)) { |
|
607 | + if (!$this->app['session']->has($key)) { |
|
608 | 608 | $this->fail("No session variable with key '$key'"); |
609 | 609 | } |
610 | 610 | |
611 | - if (! is_null($value)) { |
|
611 | + if (!is_null($value)) { |
|
612 | 612 | $this->assertEquals($value, $this->app['session']->get($key)); |
613 | 613 | } |
614 | 614 | } |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | { |
672 | 672 | $viewErrorBag = $this->app->make('view')->shared('errors'); |
673 | 673 | if (count($viewErrorBag) > 0) { |
674 | - $this->fail("Found the following form errors: \n\n" . $viewErrorBag->toJson(JSON_PRETTY_PRINT)); |
|
674 | + $this->fail("Found the following form errors: \n\n".$viewErrorBag->toJson(JSON_PRETTY_PRINT)); |
|
675 | 675 | } |
676 | 676 | } |
677 | 677 | |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | $this->fail("No form error message for key '$key'\n"); |
724 | 724 | } |
725 | 725 | |
726 | - if (! is_null($expectedErrorMessage)) { |
|
726 | + if (!is_null($expectedErrorMessage)) { |
|
727 | 727 | $this->assertContains($expectedErrorMessage, $viewErrorBag->first($key)); |
728 | 728 | } |
729 | 729 | } |
@@ -765,8 +765,8 @@ discard block |
||
765 | 765 | return; |
766 | 766 | } |
767 | 767 | |
768 | - if (! $guard->attempt($user)) { |
|
769 | - $this->fail("Failed to login with credentials " . json_encode($user)); |
|
768 | + if (!$guard->attempt($user)) { |
|
769 | + $this->fail("Failed to login with credentials ".json_encode($user)); |
|
770 | 770 | } |
771 | 771 | } |
772 | 772 | |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | $auth = $auth->guard($guard); |
792 | 792 | } |
793 | 793 | |
794 | - if (! $auth->check()) { |
|
794 | + if (!$auth->check()) { |
|
795 | 795 | $this->fail("There is no authenticated user"); |
796 | 796 | } |
797 | 797 | } |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | if (class_exists($table)) { |
865 | 865 | $model = new $table; |
866 | 866 | |
867 | - if (! $model instanceof EloquentModel) { |
|
867 | + if (!$model instanceof EloquentModel) { |
|
868 | 868 | throw new \RuntimeException("Class $table is not an Eloquent model"); |
869 | 869 | } |
870 | 870 | |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | try { |
877 | 877 | return $this->app['db']->table($table)->insertGetId($attributes); |
878 | 878 | } catch (\Exception $e) { |
879 | - $this->fail("Could not insert record into table '$table':\n\n" . $e->getMessage()); |
|
879 | + $this->fail("Could not insert record into table '$table':\n\n".$e->getMessage()); |
|
880 | 880 | } |
881 | 881 | } |
882 | 882 | |
@@ -898,10 +898,10 @@ discard block |
||
898 | 898 | public function seeRecord($table, $attributes = []) |
899 | 899 | { |
900 | 900 | if (class_exists($table)) { |
901 | - if (! $this->findModel($table, $attributes)) { |
|
902 | - $this->fail("Could not find $table with " . json_encode($attributes)); |
|
901 | + if (!$this->findModel($table, $attributes)) { |
|
902 | + $this->fail("Could not find $table with ".json_encode($attributes)); |
|
903 | 903 | } |
904 | - } elseif (! $this->findRecord($table, $attributes)) { |
|
904 | + } elseif (!$this->findRecord($table, $attributes)) { |
|
905 | 905 | $this->fail("Could not find matching record in table '$table'"); |
906 | 906 | } |
907 | 907 | } |
@@ -925,7 +925,7 @@ discard block |
||
925 | 925 | { |
926 | 926 | if (class_exists($table)) { |
927 | 927 | if ($this->findModel($table, $attributes)) { |
928 | - $this->fail("Unexpectedly found matching $table with " . json_encode($attributes)); |
|
928 | + $this->fail("Unexpectedly found matching $table with ".json_encode($attributes)); |
|
929 | 929 | } |
930 | 930 | } elseif ($this->findRecord($table, $attributes)) { |
931 | 931 | $this->fail("Unexpectedly found matching record in table '$table'"); |
@@ -952,14 +952,14 @@ discard block |
||
952 | 952 | public function grabRecord($table, $attributes = []) |
953 | 953 | { |
954 | 954 | if (class_exists($table)) { |
955 | - if (! $model = $this->findModel($table, $attributes)) { |
|
956 | - $this->fail("Could not find $table with " . json_encode($attributes)); |
|
955 | + if (!$model = $this->findModel($table, $attributes)) { |
|
956 | + $this->fail("Could not find $table with ".json_encode($attributes)); |
|
957 | 957 | } |
958 | 958 | |
959 | 959 | return $model; |
960 | 960 | } |
961 | 961 | |
962 | - if (! $record = $this->findRecord($table, $attributes)) { |
|
962 | + if (!$record = $this->findRecord($table, $attributes)) { |
|
963 | 963 | $this->fail("Could not find matching record in table '$table'"); |
964 | 964 | } |
965 | 965 | |
@@ -987,12 +987,12 @@ discard block |
||
987 | 987 | if (class_exists($table)) { |
988 | 988 | $currentNum = $this->countModels($table, $attributes); |
989 | 989 | if ($currentNum != $expectedNum) { |
990 | - $this->fail("The number of found $table ($currentNum) does not match expected number $expectedNum with " . json_encode($attributes)); |
|
990 | + $this->fail("The number of found $table ($currentNum) does not match expected number $expectedNum with ".json_encode($attributes)); |
|
991 | 991 | } |
992 | 992 | } else { |
993 | 993 | $currentNum = $this->countRecords($table, $attributes); |
994 | 994 | if ($currentNum != $expectedNum) { |
995 | - $this->fail("The number of found records ($currentNum) does not match expected number $expectedNum in table $table with " . json_encode($attributes)); |
|
995 | + $this->fail("The number of found records ($currentNum) does not match expected number $expectedNum in table $table with ".json_encode($attributes)); |
|
996 | 996 | } |
997 | 997 | } |
998 | 998 | } |
@@ -1015,7 +1015,7 @@ discard block |
||
1015 | 1015 | */ |
1016 | 1016 | public function grabNumRecords($table, $attributes = []) |
1017 | 1017 | { |
1018 | - return class_exists($table)? $this->countModels($table, $attributes) : $this->countRecords($table, $attributes); |
|
1018 | + return class_exists($table) ? $this->countModels($table, $attributes) : $this->countRecords($table, $attributes); |
|
1019 | 1019 | } |
1020 | 1020 | |
1021 | 1021 | /** |
@@ -1046,7 +1046,7 @@ discard block |
||
1046 | 1046 | $query->where($key, $value); |
1047 | 1047 | } |
1048 | 1048 | |
1049 | - return (array) $query->first(); |
|
1049 | + return (array)$query->first(); |
|
1050 | 1050 | } |
1051 | 1051 | |
1052 | 1052 | /** |
@@ -1136,7 +1136,7 @@ discard block |
||
1136 | 1136 | |
1137 | 1137 | return $result; |
1138 | 1138 | } catch (\Exception $e) { |
1139 | - $this->fail("Could not create model: \n\n" . get_class($e) . "\n\n" . $e->getMessage()); |
|
1139 | + $this->fail("Could not create model: \n\n".get_class($e)."\n\n".$e->getMessage()); |
|
1140 | 1140 | } |
1141 | 1141 | } |
1142 | 1142 | |
@@ -1165,7 +1165,7 @@ discard block |
||
1165 | 1165 | try { |
1166 | 1166 | return $this->modelFactory($model, $name, $times)->create($attributes); |
1167 | 1167 | } catch (\Exception $e) { |
1168 | - $this->fail("Could not create model: \n\n" . get_class($e) . "\n\n" . $e->getMessage()); |
|
1168 | + $this->fail("Could not create model: \n\n".get_class($e)."\n\n".$e->getMessage()); |
|
1169 | 1169 | } |
1170 | 1170 | } |
1171 | 1171 | |
@@ -1178,8 +1178,8 @@ discard block |
||
1178 | 1178 | */ |
1179 | 1179 | protected function modelFactory($model, $name, $times = 1) |
1180 | 1180 | { |
1181 | - if (! function_exists('factory')) { |
|
1182 | - throw new ModuleException($this, 'The factory() method does not exist. ' . |
|
1181 | + if (!function_exists('factory')) { |
|
1182 | + throw new ModuleException($this, 'The factory() method does not exist. '. |
|
1183 | 1183 | 'This functionality relies on Laravel model factories, which were introduced in Laravel 5.1.'); |
1184 | 1184 | } |
1185 | 1185 | |
@@ -1213,7 +1213,7 @@ discard block |
||
1213 | 1213 | $server = ReflectionHelper::readPrivateProperty($this->client, 'server'); |
1214 | 1214 | $domain = $server['HTTP_HOST']; |
1215 | 1215 | |
1216 | - return '/^' . str_replace('.', '\.', $domain) . '$/'; |
|
1216 | + return '/^'.str_replace('.', '\.', $domain).'$/'; |
|
1217 | 1217 | } |
1218 | 1218 | |
1219 | 1219 | /** |
@@ -236,7 +236,7 @@ |
||
236 | 236 | * It is not recommended to use this command on a regular basis. |
237 | 237 | * If Codeception lacks important Guzzle Client methods, implement them and submit patches. |
238 | 238 | * |
239 | - * @param callable $function |
|
239 | + * @param \Closure $function |
|
240 | 240 | */ |
241 | 241 | public function executeInGuzzle(\Closure $function) |
242 | 242 | { |