Skip to content

Commit cfacce0

Browse files
authored
Merge pull request #32 from Bee-Lab/docs
📝 improve docs
2 parents 5374415 + 9acf9b8 commit cfacce0

File tree

4 files changed

+23
-20
lines changed

4 files changed

+23
-20
lines changed

.github/workflows/build.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: build
22

33
on:
4+
push:
5+
branches:
6+
- main
47
pull_request: ~
5-
push: ~
68

79
jobs:
810
phpstan:
@@ -37,16 +39,16 @@ jobs:
3739
php: '8.2'
3840
symfony: '6.4.*'
3941
composer_option: '--prefer-lowest'
40-
- description: 'Symfony 7.1'
42+
- description: 'Symfony 7.3'
4143
php: '8.3'
42-
symfony: '7.1.*'
43-
- description: 'Symfony 7.2'
44+
symfony: '7.3.*'
45+
- description: 'Symfony 7.4'
4446
php: '8.4'
45-
symfony: '7.2.*@dev'
47+
symfony: '7.4.*@dev'
4648
name: PHP ${{ matrix.php }} tests (${{ matrix.description }})
4749
steps:
4850
- name: Checkout
49-
uses: actions/checkout@v3
51+
uses: actions/checkout@v4
5052
- name: Cache
5153
uses: actions/cache@v3
5254
with:
@@ -68,8 +70,10 @@ jobs:
6870
- name: update vendors
6971
run: composer update --no-interaction --no-progress --ansi ${{ matrix.composer_option }}
7072
- name: run tests
71-
run: bin/phpunit --coverage-clover=clover.xml
73+
run: bin/phpunit --colors=always --coverage-clover=clover.xml
7274
- name: save test coverage
73-
uses: codecov/codecov-action@v1
75+
if: ${{ matrix.php == '8.4' }}
76+
uses: qltysh/qlty-action/coverage@v1
7477
with:
75-
files: ./clover.xml
78+
token: ${{secrets.QLTY_COVERAGE_TOKEN}}
79+
files: clover.xml

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# BeelabTestBundle
22

33
[![Build Status](https://github.com/Bee-Lab/BeelabTestBundle/workflows/build/badge.svg)](https://github.com/Bee-Lab/BeelabTestBundle/actions)
4-
[![codecov](https://codecov.io/github/Bee-Lab/BeelabTestBundle/branch/master/graph/badge.svg?token=xU1pOUeU3M)](https://codecov.io/github/Bee-Lab/BeelabTestBundle)
4+
[![Code Coverage](https://qlty.sh/gh/Bee-Lab/projects/BeelabTestBundle/coverage.svg)](https://qlty.sh/gh/Bee-Lab/projects/BeelabTestBundle)
55

6-
This bundle contains just an opinionated extension of Symfony `WebTestCase`.
6+
This bundle contains an opinionated extension of Symfony `WebTestCase`.
77

88
## Documentation
99

docs/index.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ services:
6969

7070
* Browser output debug
7171

72-
You can output the content of response in your browser, just calling `self::saveOutput()`.
72+
You can output the content of the response in your browser, just calling `self::saveOutput()`.
7373
You can define a parameter named `domain`, otherwise standard localhost will be used.
7474
The output is saved under the document root and displayed with a browser (by default, `/usr/bin/firefox`),
7575
then the page is deleted.
7676
You can pass `false` as argument to prevent page deletion (in this case, you can get it from your document
77-
root directory.
78-
Don't forget to remove it by hand, then).
77+
root directory. Don't forget to remove it by hand, then).
7978
If you want to change browser path, define it in your configuration:
79+
8080
```yaml
8181
# config/packages/test/beelab_test.yaml
8282
beelab_test:
@@ -91,10 +91,8 @@ services:
9191

9292
* Assert presence of many selectors
9393

94-
`self::assertSelectorCounts()` method works like native `self::assertSelectorExists()`.
95-
For example, you can check for presence of `div.alert-success` using
96-
`self::assertSelectorExists('div.alert-success')` or using `self::assertSelectorCounts(1, 'div.alert-success')`
97-
(the latter being more specific, and more flexible).
94+
An old method `self::assertSelectorCounts()` is still available, but deprecated.
95+
You should use the native method ``self::assertSelectorCount()` instead.
9896

9997
### Authentication-related
10098

@@ -106,6 +104,7 @@ services:
106104
`self::login('myuser', 'main', 'fos_user.user_provider.username');`.
107105
Another notable service you can use is Symfony's built-in `security.user.provider.concrete.in_memory`.
108106
For basic usage, just pass the username as first argument.
107+
To avoid passing the service every time, you can configure it.
109108

110109
Example of configuration:
111110
```yaml
@@ -134,7 +133,7 @@ services:
134133
In forms with more than a field of the same type, use `self::getImageFile('1')`, `self::getImageFile('2')`, etc.
135134
You can also use `self::getFile('0', $data, 'png', 'image/png')` and pass directly your file data.
136135

137-
💡 ** Bonus** The above methods are shortcuts for the `Beelab\TestBundle\File\FileInjector` class, so you
136+
💡 **Bonus** The above methods are shortcuts for the `Beelab\TestBundle\File\FileInjector` class, so you
138137
can use them in your fixtures, too. Import the class and use `FileInjector::getFile(fixture: true)` etc.
139138
Don't forget to pass the `$fixture` argument.
140139

src/Test/WebTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected static function saveOutput(bool $delete = true): void
7676

7777
/**
7878
* Login
79-
* See https://web.archive.org/web/20131002151908/http://blog.bee-lab.net/login-automatico-con-fosuserbundle/
79+
* See https://github.com/Bee-Lab/BeelabTestBundle/blob/master/docs/index.md#authentication-related
8080
* Be sure that $firewall matches the entry in your security.yaml configuration.
8181
*
8282
* @throws \InvalidArgumentException

0 commit comments

Comments
 (0)