Skip to content

Commit b761fc7

Browse files
committed
Update contributing docs
1 parent 21d04bc commit b761fc7

File tree

4 files changed

+39
-15
lines changed

4 files changed

+39
-15
lines changed

CONTRIBUTING.md

Lines changed: 26 additions & 1 deletion
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,7 +69,7 @@ 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

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
@@ -55,13 +55,16 @@
5555
},
5656
"laravel": {
5757
"providers": [
58-
"MongoDBServiceProvider",
59-
"MongoDBQueueServiceProvider"
58+
"MongoDB\\Laravel\\MongoDBServiceProvider",
59+
"MongoDB\\Laravel\\MongoDBQueueServiceProvider"
6060
]
6161
}
6262
},
6363
"minimum-stability": "dev",
6464
"config": {
65+
"platform": {
66+
"php": "8.1"
67+
},
6568
"allow-plugins": {
6669
"dealerdirect/phpcodesniffer-composer-installer": true
6770
}

0 commit comments

Comments
 (0)