Skip to content

Commit f32a941

Browse files
Added CONTRIBUTING.md (#15)
Co-authored-by: ThomasLandauer <[email protected]>
1 parent e17344e commit f32a941

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

CONTRIBUTING.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# How to Contribute
2+
3+
First of all: Contributions are very welcome!
4+
5+
**Does your change require a test?**
6+
7+
## No, my change does not require a test
8+
So you're going to make a small change or improve the documentation? Hey, you rock!
9+
10+
- Either just edit [`Laravel.php`](https://github.com/Codeception/module-laravel/blob/main/src/Codeception/Module/Laravel.php) on GitHub's website.
11+
- Make sure to add a descriptive title and add an explanation for your changes.
12+
13+
> :bulb: You can also create a *fork* and *cloning it* on your local machine, as explained in the next section.
14+
15+
## Yes, my change requires a test
16+
17+
So you're going to add or modify functionality? Hey, you rock too!
18+
19+
You can use our prepared [Codeception/laravel-module-tests](https://github.com/Codeception/laravel-module-tests).
20+
It is a minimal (but complete) Laravel project, ready to run tests.
21+
22+
### 1. Edit locally
23+
24+
- Go to [Codeception/laravel-module-tests](https://github.com/Codeception/laravel-module-tests) and fork the project.
25+
Then follow the installation instructions.
26+
<br/>
27+
- Edit the module's source code in the `vendor/codeception/module-laravel/src/Codeception/Module/Laravel.php` file.
28+
<br/>
29+
- If you created a new method, you can test it by adding a test in the `tests/Functional/LaravelModuleCest.php` file.
30+
> :bulb: Be sure to Rebuild Codeception's "Actor" classes (see [Console Commands](https://codeception.com/docs/reference/Commands#Build)):
31+
> ```shell
32+
> vendor/bin/codecept clean
33+
> vendor/bin/codecept build
34+
> ```
35+
> With this, your IDE will be able to recognize and autocomplete your new method.
36+
37+
- Then, run the tests with the `vendor/bin/codecept run Functional` command.
38+
39+
### 2. Confirm your changes
40+
41+
- If you are satisfied with your changes, the next step is to fork [Codeception/module-laravel](https://github.com/Codeception/module-laravel).
42+
In your terminal, go to another directory, then:
43+
```shell
44+
# Clone the repo
45+
git clone https://github.com/YourUserName/module-laravel.git
46+
47+
# Create a new branch for your change
48+
cd module-laravel
49+
git checkout -b new_feature
50+
```
51+
> :bulb: If you've created a fork before, make sure to [sync the changes](https://stackoverflow.com/a/7244456).
52+
53+
- Copy the changes from the `Laravel.php` of the test project to the `src/Codeception/Module/Laravel.php` file on your Module's fork.
54+
<br/>
55+
- Commit:
56+
```shell
57+
git add --all
58+
git commit --message="Briefly explain what your change is about"
59+
git push --set-upstream origin new_feature
60+
```
61+
62+
### 3. Create a Pull Request
63+
64+
- In the CLI output, click on the link to `https://github.com/YourUserName/module-laravel/pull/new/new_feature` to create a Pull Request through GitHub.com.
65+
66+
Now wait for feedback on your Pull Request. If all is fine and gets merged...
67+
68+
### 4. Send a Test
69+
70+
- In the test project (`laravel-module-tests`), create a test with the same name as your new method in `tests/Functional/LaravelModuleCest.php`, following alphabetical order.
71+
72+
- Run the tests with `vendor/bin/codecept run Functional` command.
73+
74+
- Commit:
75+
```shell
76+
git checkout -b new_test
77+
git add --all
78+
git commit --message="Describe what feature you are testing"
79+
git push --set-upstream origin new_test
80+
```
81+
82+
- In the CLI output, click on the link to `https://github.com/YourUserName/laravel-module-tests/pull/new/new_test` to create a Pull Request through `GitHub.com`.
83+
Don't forget to add a link to the module's Pull Request you created.

readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ composer require "codeception/module-laravel" --dev
2222

2323
See [the module documentation](https://codeception.com/docs/modules/Laravel5).
2424

25+
### How to Contribute
26+
27+
See [the contribution guide](/CONTRIBUTING.md).
28+
2529
## License
2630

2731
`Codeception Module Laravel` is open-sourced software licensed under the [MIT](/LICENSE) License.

0 commit comments

Comments
 (0)