Skip to content

Commit 12ff495

Browse files
authored
Merge pull request #90 from FelixJacobi/split-integration-test-suite
Split integration test suite into non-invasive integration and invasive functional suite
2 parents 3843c9b + 24e2795 commit 12ff495

9 files changed

Lines changed: 31 additions & 42 deletions

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Install php dependencies
3131
run: composer install --dev --no-interaction
3232
- name: Execute tests without coverage
33-
run: vendor/bin/phpunit --testsuite="BigBlueButton test suite"
33+
run: vendor/bin/phpunit --testsuite="BigBlueButton unit test suite,BigBlueButton integration test suite"
3434

3535
PHP:
3636
name: PHP ${{ matrix.php-versions }}
@@ -66,7 +66,7 @@ jobs:
6666
if: ${{ !matrix.experimental }}
6767
run: |
6868
mkdir -p build/logs
69-
vendor/bin/phpunit --coverage-clover=build/logs/coverage.xml --testsuite="BigBlueButton test suite"
69+
vendor/bin/phpunit --coverage-clover=build/logs/coverage.xml --testsuite="BigBlueButton unit test suite,BigBlueButton integration test suite"
7070
- name: Execute tests without coverage
7171
if: ${{ matrix.experimental }}
7272
run: vendor/bin/phpunit --testsuite="BigBlueButton test suite"

composer.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,15 @@
9494
"BigBlueButton\\": ["src", "tests/integration"]
9595
}
9696
},
97+
"autoload-dev": {
98+
"psr-4": {
99+
"BigBlueButton\\Tests\\Functional\\": ["tests/functional"]
100+
}
101+
},
97102
"scripts": {
98-
"test": "vendor/bin/phpunit",
99-
"test-integration": "vendor/bin/phpunit --testsuite=\"BigBlueButton integration test suite\" --exclude-group=integration-legacy",
103+
"test": "vendor/bin/phpunit --testsuite=\"BigBlueButton unit test suite\"",
104+
"test-integration": "vendor/bin/phpunit --testsuite=\"BigBlueButton integration test suite\"",
105+
"test-functional": "vendor/bin/phpunit --testsuite=\"BigBlueButton functional test suite\" --exclude-group=functional-legacy",
100106
"cs-fix": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
101107
"cs-test": "vendor/bin/php-cs-fixer fix --dry-run --allow-risky=yes",
102108
"psalm": "psalm --threads=1",
@@ -111,7 +117,7 @@
111117
"vendor/bin/php-cs-fixer fix --dry-run --allow-risky=yes"
112118
],
113119
"pre-push": [
114-
"vendor/bin/phpunit --testsuite=\"BigBlueButton test suite\"",
120+
"vendor/bin/phpunit --testsuite=\"BigBlueButton unit test suite,BigBlueButton integration test suite\"",
115121
"vendor/bin/psalm --threads=1"
116122
],
117123
"post-merge": "composer install",

phpunit-integration.xml.dist

Lines changed: 0 additions & 26 deletions
This file was deleted.

phpunit.xml.dist

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
</filter>
1919

2020
<testsuites>
21-
<testsuite name="BigBlueButton test suite">
21+
<testsuite name="BigBlueButton unit test suite">
2222
<directory>./tests/unit/</directory>
2323
</testsuite>
2424
<testsuite name="BigBlueButton integration test suite">
2525
<directory>./tests/integration/</directory>
2626
</testsuite>
27+
<testsuite name="BigBlueButton functional test suite">
28+
<directory>./tests/functional/</directory>
29+
</testsuite>
2730
</testsuites>
2831

2932
</phpunit>

tests/integration/AbstractBigBlueButtonIntegrationTest.php renamed to tests/functional/AbstractBigBlueButtonFunctionalTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
* You should have received a copy of the GNU Lesser General Public License along
1717
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
1818
*/
19-
namespace BigBlueButton;
19+
namespace BigBlueButton\Tests\Functional;
2020

21+
use BigBlueButton\BigBlueButton;
2122
use BigBlueButton\Http\Transport\TransportInterface;
2223
use BigBlueButton\Parameters\DeleteRecordingsParameters;
2324
use BigBlueButton\Parameters\EndMeetingParameters;
@@ -26,12 +27,13 @@
2627
use BigBlueButton\Parameters\IsMeetingRunningParameters;
2728
use BigBlueButton\Parameters\JoinMeetingParameters;
2829
use BigBlueButton\Parameters\PublishRecordingsParameters;
30+
use BigBlueButton\TestCase;
2931

3032
/**
3133
* Class BigBlueButtonIntegrationTest
3234
* @package BigBlueButton
3335
*/
34-
abstract class AbstractBigBlueButtonIntegrationTest extends TestCase
36+
abstract class AbstractBigBlueButtonFunctionalTest extends TestCase
3537
{
3638
/**
3739
* @var BigBlueButton
@@ -200,7 +202,7 @@ public function testJoinMeeting()
200202
/* Get Default Config XML */
201203

202204
/**
203-
* @group integration-legacy
205+
* @group functional-legacy
204206
*/
205207
public function testGetDefaultConfigXML()
206208
{
@@ -209,7 +211,7 @@ public function testGetDefaultConfigXML()
209211
}
210212

211213
/**
212-
* @group integration-legacy
214+
* @group functional-legacy
213215
*/
214216
public function testSetConfigXML()
215217
{

tests/integration/BigBlueButtonWithCurlTransportTest.php renamed to tests/functional/BigBlueButtonWithCurlTransportTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
* You should have received a copy of the GNU Lesser General Public License
1919
* along with littleredbutton/bigbluebutton-api-php. If not, see <http://www.gnu.org/licenses/>.
2020
*/
21-
namespace BigBlueButton;
21+
namespace BigBlueButton\Tests\Functional;
2222

2323
use BigBlueButton\Http\Transport\CurlTransport;
2424
use BigBlueButton\Http\Transport\TransportInterface;
2525

26-
final class BigBlueButtonWithCurlTransportTest extends AbstractBigBlueButtonIntegrationTest
26+
final class BigBlueButtonWithCurlTransportTest extends AbstractBigBlueButtonFunctionalTest
2727
{
2828
/**
2929
* {@inheritDoc}

tests/integration/BigBlueButtonWithPsrHttpClientTransport.php renamed to tests/functional/BigBlueButtonWithPsrHttpClientTransport.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
* You should have received a copy of the GNU Lesser General Public License
1919
* along with littleredbutton/bigbluebutton-api-php. If not, see <http://www.gnu.org/licenses/>.
2020
*/
21-
namespace BigBlueButton;
21+
namespace BigBlueButton\Tests\Functional;
2222

2323
use BigBlueButton\Http\Transport\Bridge\PsrHttpClient\PsrHttpClientTransport;
2424
use BigBlueButton\Http\Transport\TransportInterface;
2525
use Nyholm\Psr7\Factory\Psr17Factory;
2626
use Symfony\Component\HttpClient\CurlHttpClient;
2727
use Symfony\Component\HttpClient\Psr18Client;
2828

29-
final class BigBlueButtonWithPsrHttpClientTransport extends AbstractBigBlueButtonIntegrationTest
29+
final class BigBlueButtonWithPsrHttpClientTransport extends AbstractBigBlueButtonFunctionalTest
3030
{
3131
/**
3232
* {@inheritDoc}

tests/integration/BigBlueButtonWithSymfonyHttpClientTransportTest.php renamed to tests/functional/BigBlueButtonWithSymfonyHttpClientTransportTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
* You should have received a copy of the GNU Lesser General Public License
1919
* along with littleredbutton/bigbluebutton-api-php. If not, see <http://www.gnu.org/licenses/>.
2020
*/
21-
namespace BigBlueButton;
21+
namespace BigBlueButton\Tests\Functional;
2222

2323
use BigBlueButton\Http\Transport\Bridge\SymfonyHttpClient\SymfonyHttpClientTransport;
2424
use BigBlueButton\Http\Transport\TransportInterface;
2525

26-
final class BigBlueButtonWithSymfonyHttpClientTransportTest extends AbstractBigBlueButtonIntegrationTest
26+
final class BigBlueButtonWithSymfonyHttpClientTransportTest extends AbstractBigBlueButtonFunctionalTest
2727
{
2828
/**
2929
* {@inheritDoc}

tests/integration/Http/Transport/CurlTransportTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ public function testRequestWithoutPayload(): void
121121

122122
public function testRequestWithCookie(): void
123123
{
124+
if (\PHP_VERSION_ID >= 80000) {
125+
self::markTestSkipped('Broken on PHP 8. To be fixed in https://github.com/littleredbutton/bigbluebutton-api-php/pull/78.');
126+
}
127+
124128
$request = new TransportRequest('http://localhost:8057/cookie.php', '', 'application/xml');
125129
$transport = new CurlTransport();
126130

0 commit comments

Comments
 (0)