Skip to content

Commit b55e5da

Browse files
authored
PHPORM-31 Split documentation into multiple files (mongodb#2610)
Split readme into smaller files to helps the reader. Fix letter case of MongoDBServiceProvider Add more details in the new upgrade file Update contributing docs and fix the docker config to avoid php version conflicts in docker
1 parent f5f93a3 commit b55e5da

16 files changed

+1249
-1226
lines changed

.codacy.yml

-2
This file was deleted.

.styleci.yml

-2
This file was deleted.

CONTRIBUTING.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,32 @@ 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+
Tests requiring MySQL will be skipped if it is not running.
43+
Duplicate the `phpunit.xml.dist` file to `phpunit.xml` and edit the environment variables to match your setup.
44+
45+
```bash
46+
$ docker-compose up -d mongodb mysql
47+
$ docker-compose run tests
48+
```
49+
50+
Docker can be slow to start. You can run the command `php vendor/bin/phpunit --testdox` locally or in a docker container.
51+
52+
```bash
53+
$ docker-compose run -it tests bash
54+
# Inside the container
55+
$ composer install
56+
$ vendor/bin/phpunit --testdox
57+
```
58+
59+
For fixing style issues, you can run the PHP Code Beautifier and Fixer:
60+
61+
```bash
62+
$ php vendor/bin/phpcbf
63+
```
64+
3965
## Requirements
4066

4167
If the project maintainer has any additional requirements, you will find them listed here.
@@ -44,7 +70,7 @@ If the project maintainer has any additional requirements, you will find them li
4470

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

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

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

Dockerfile

+4-6
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"]

0 commit comments

Comments
 (0)