Skip to content

Commit 07b0fae

Browse files
committed
fix code typeO's, remove unneeded files and fix travis
1 parent 440e020 commit 07b0fae

File tree

12 files changed

+52
-48
lines changed

12 files changed

+52
-48
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
/node_modules
33
/tests/_output
44
/tests/_support/_generated
5+
/storage/*.sqlite
56
/tests/api/ApiTester.php
67
/tests/functional/FunctionalTester.php
78
/tests/unit/UnitTester.php
8-
/storage/*.sqlite
9-
/tags
109
.env
1110
.idea
1211
.vagrant

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: php
2-
2+
dist: trusty
33
php:
44
- 7.1
55
- 7.0

composer.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
"fzaninotto/faker": "~1.4"
1111
},
1212
"require-dev": {
13-
"phpunit/phpunit": "~4.0",
14-
"phpspec/phpspec": "~2.1",
1513
"codeception/codeception": "2.3.x-dev",
1614
"symfony/dom-crawler": "~3.0",
1715
"symfony/css-selector": "~3.0"

config/auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
21
<?php
2+
33
return [
44
/*
55
|--------------------------------------------------------------------------

phpspec.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

phpunit.xml

Lines changed: 0 additions & 22 deletions
This file was deleted.

readme.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,22 @@ Run Codeception, installed via Composer
3939

4040
## Tests
4141

42-
Please check out some [good test examples](https://github.com/janhenkgerritsen/codeception-laravel5-sample/tree/codeception-2.1/tests) provided.
42+
Please check out `/tests` folder for some good test examples provided.
4343

4444
### Functional Tests
4545

46-
Demonstrates testing of [CRUD application](https://github.com/janhenkgerritsen/codeception-laravel5-sample/blob/codeception-2.1/tests/functional/PostCrudCest.php) with
46+
Demonstrates testing of CRUD application with
4747

48-
* [PageObjects](https://github.com/janhenkgerritsen/codeception-laravel5-sample/blob/codeception-2.1/tests%2Ffunctional%2F_pages%2FPostsPage.php)
49-
* [authentication](https://github.com/janhenkgerritsen/codeception-laravel5-sample/blob/codeception-2.1/tests%2Ffunctional%2FAuthCest.php) (by user, credentials, http auth)
48+
* PageObjects
49+
* authentication (by user, credentials, http auth)
5050
* usage of session variables
51-
* [routes](https://github.com/janhenkgerritsen/codeception-laravel5-sample/blob/codeception-2.1/tests%2Ffunctional%2FRoutesCest.php)
51+
* routes
5252
* creating and checking records in database
5353
* testing of form errors
5454

5555
### API Tests
5656

57-
Demonstrates functional [testing of API](https://github.com/janhenkgerritsen/codeception-laravel5-sample/blob/codeception-2.1/tests%2Fapi%2FPostsResourceCest.php) using REST and Laravel5 modules connected, with
57+
Demonstrates functional testing of API using REST and Laravel5 modules connected, with
5858

5959
* partial json inclusion in response
6060
* GET/POST/PUT/DELETE requests

tests/_support/ApiTester.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
43
/**
54
* Inherited Methods
65
* @method void wantToTest($text)
@@ -19,9 +18,7 @@
1918
class ApiTester extends \Codeception\Actor
2019
{
2120
use _generated\ApiTesterActions;
22-
2321
/**
2422
* Define custom actions here
2523
*/
26-
2724
}

tests/_support/Page/Functional/PostsPage.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
namespace Page\Functional;
43

54
use FunctionalTester;
@@ -8,6 +7,10 @@ class PostsPage
87
{
98
public static $url = '/posts';
109

10+
/**
11+
* @param $param
12+
* @return string
13+
*/
1114
public static function route($param)
1215
{
1316
return static::$url . $param;
@@ -25,6 +28,10 @@ public function __construct(FunctionalTester $I)
2528
$this->tester = $I;
2629
}
2730

31+
/**
32+
* @param array $fields
33+
* @throws \Exception
34+
*/
2835
public function createPost($fields = [])
2936
{
3037
$I = $this->tester;
@@ -34,6 +41,11 @@ public function createPost($fields = [])
3441
$I->click('Submit');
3542
}
3643

44+
/**
45+
* @param $id
46+
* @param array $fields
47+
* @throws \Exception
48+
*/
3749
public function editPost($id, $fields = [])
3850
{
3951
$I = $this->tester;
@@ -43,13 +55,20 @@ public function editPost($id, $fields = [])
4355
$I->click('Update');
4456
}
4557

58+
/**
59+
* @param $id
60+
*/
4661
public function deletePost($id)
4762
{
4863
$I = $this->tester;
4964
$I->amOnPage(self::route("/$id"));
5065
$I->click('Delete');
5166
}
5267

68+
/**
69+
* @param $data
70+
* @throws \Exception
71+
*/
5372
protected function fillFormFields($data)
5473
{
5574
foreach ($data as $field => $value) {
@@ -59,5 +78,4 @@ protected function fillFormFields($data)
5978
$this->tester->fillField(static::$formFields[$field], $value);
6079
}
6180
}
62-
6381
}

tests/api.suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ modules:
66
- REST:
77
depends: Laravel5
88
- Laravel5:
9-
environment_file: .env.testing
9+
environment_file: .env.testing

0 commit comments

Comments
 (0)