Skip to content

Commit 5a8b464

Browse files
committed
Update contributing docs
1 parent 0bbb058 commit 5a8b464

File tree

4 files changed

+40
-16
lines changed

4 files changed

+40
-16
lines changed

CONTRIBUTING.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,31 @@ Before submitting a pull request:
3636
- Check the codebase to ensure that your feature doesn't already exist.
3737
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
3838

39+
## Run Tests
40+
41+
The full test suite requires PHP cli with mongodb extension, a running MongoDB server and a running MySQL server.
42+
Duplicate the `phpunit.xml.dist` file to `phpunit.xml` and edit the environment variables to match your setup.
43+
44+
```bash
45+
$ docker-compose up -d mongodb mysql
46+
$ docker-compose run tests
47+
```
48+
49+
Docker can be slow to start. You can run the command `php vendor/bin/phpunit --testdox` locally or in a docker container.
50+
51+
```bash
52+
$ docker-compose run -it tests bash
53+
# Inside the container
54+
$ composer install
55+
$ vendor/bin/phpunit --testdox
56+
```
57+
58+
For fixing style issues, you can run the PHP Code Beautifier and Fixer:
59+
60+
```bash
61+
$ php vendor/bin/phpcbf
62+
```
63+
3964
## Requirements
4065

4166
If the project maintainer has any additional requirements, you will find them listed here.
@@ -44,12 +69,12 @@ If the project maintainer has any additional requirements, you will find them li
4469

4570
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
4671

47-
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
72+
- **Document any change in behaviour** - Make sure the documentations are kept up-to-date.
4873

4974
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option.
5075

5176
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
5277

5378
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
5479

55-
**Happy coding**!
80+
**Happy coding**!

Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ RUN apt-get update && \
88
pecl install xdebug && docker-php-ext-enable xdebug && \
99
docker-php-ext-install -j$(nproc) pdo_mysql zip
1010

11-
COPY --from=composer:2.5.8 /usr/bin/composer /usr/local/bin/composer
11+
COPY --from=composer:2.6.2 /usr/bin/composer /usr/local/bin/composer
12+
13+
ENV COMPOSER_ALLOW_SUPERUSER=1
1214

1315
WORKDIR /code
1416

1517
COPY ./ ./
1618

17-
ENV COMPOSER_ALLOW_SUPERUSER=1
18-
19-
RUN composer install
20-
21-
CMD ["./vendor/bin/phpunit", "--testdox"]
19+
CMD ["bash", "-c", "composer install && ./vendor/bin/phpunit --testdox"]

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,14 @@ It is compatible with Laravel 10.x. For older versions of Laravel, please refer
1616
- [Eloquent Models](docs/eloquent-models.md)
1717
- [Query Builder](docs/query-builder.md)
1818
- [Transactions](docs/transactions.md)
19+
- [User Authentication](docs/authentication.md)
1920
- [Queues](docs/queues.md)
2021
- [Upgrading](docs/upgrade.md)
2122

2223
## Reporting Issues
2324

24-
Issues pertaining to the library should be reported in the
25-
[PHPLIB](https://jira.mongodb.org/secure/CreateIssue!default.jspa?project-field=PHPLIB)
26-
project in MongoDB's JIRA. Extension-related issues should be reported in the
27-
[PHPC](https://jira.mongodb.org/secure/CreateIssue!default.jspa?project-field=PHPC)
28-
project.
25+
Issues pertaining to the library should be reported as
26+
[GitHub Issue](https://github.com/mongodb/laravel-mongodb/issues/new/choose).
2927

3028
For general questions and support requests, please use one of MongoDB's
3129
[Technical Support](https://mongodb.com/docs/manual/support/) channels.
@@ -39,6 +37,6 @@ project, please report it according to the instructions in
3937
## Development
4038

4139
Development is tracked in the
42-
[PHPLIB](https://jira.mongodb.org/projects/PHPORM/summary) project in MongoDB's
40+
[PHPORM](https://jira.mongodb.org/projects/PHPORM/summary) project in MongoDB's
4341
JIRA. Documentation for contributing to this project may be found in
4442
[CONTRIBUTING.md](CONTRIBUTING.md).

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,16 @@
5252
"extra": {
5353
"laravel": {
5454
"providers": [
55-
"MongoDBServiceProvider",
56-
"MongoDBQueueServiceProvider"
55+
"MongoDB\\Laravel\\MongoDBServiceProvider",
56+
"MongoDB\\Laravel\\MongoDBQueueServiceProvider"
5757
]
5858
}
5959
},
6060
"minimum-stability": "dev",
6161
"config": {
62+
"platform": {
63+
"php": "8.1"
64+
},
6265
"allow-plugins": {
6366
"dealerdirect/phpcodesniffer-composer-installer": true
6467
}

0 commit comments

Comments
 (0)