mirror of
https://github.com/farmOS/farmOS.git
synced 2024-02-23 11:37:38 +01:00
Merge branch 'tests' into 2.0.x
This commit is contained in:
commit
267d9a8534
19
.github/workflows/run-tests.yml
vendored
Normal file
19
.github/workflows/run-tests.yml
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
name: Run 2.0.x PHPUnit tests
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '2.0.x'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Run PHPUnit tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create docker-compose.yml
|
||||
run: curl https://raw.githubusercontent.com/mstenta/farmOS/2.0.x/docker/docker-compose.development.yml -o docker-compose.yml
|
||||
- name: Start containers
|
||||
run: sudo docker-compose up -d
|
||||
- name: Wait 10 seconds
|
||||
run: sleep 10
|
||||
- name: Run tests
|
||||
run: sudo docker exec -i -u www-data farmos_www_1 vendor/bin/phpunit --verbose --debug --group farm
|
|
@ -19,6 +19,16 @@ USER www-data
|
|||
# Generate an empty project from farmos/project.
|
||||
RUN composer create-project --stability=dev farmos/project .
|
||||
|
||||
# Configure PHPUnit.
|
||||
RUN cp web/core/phpunit.xml.dist phpunit.xml \
|
||||
&& sed -i 's|bootstrap="tests/bootstrap.php"|bootstrap="web/core/tests/bootstrap.php"|g' phpunit.xml \
|
||||
&& sed -i 's|name="SIMPLETEST_BASE_URL" value=""|name="SIMPLETEST_BASE_URL" value="http://localhost"|g' phpunit.xml \
|
||||
&& sed -i 's|name="SIMPLETEST_DB" value=""|name="SIMPLETEST_DB" value="pgsql://farm:farm@db/farm"|g' phpunit.xml \
|
||||
&& sed -i 's|name="BROWSERTEST_OUTPUT_DIRECTORY" value=""|name="BROWSERTEST_OUTPUT_DIRECTORY" value="/var/www/html/web/sites/simpletest/browser_output"|g' phpunit.xml \
|
||||
&& sed -i 's|\./|\./web/core/|g' phpunit.xml \
|
||||
&& sed -i 's|\.\./web/core/|\./web/|g' phpunit.xml \
|
||||
&& mkdir -p /var/www/farmOS/web/sites/simpletest/browser_output
|
||||
|
||||
# Switch back to the /var/www/html directory as the root user.
|
||||
WORKDIR /var/www/html
|
||||
USER root
|
||||
|
|
28
tests/src/Functional/FarmTest.php
Normal file
28
tests/src/Functional/FarmTest.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\farm\Functional;
|
||||
|
||||
use Drupal\Tests\BrowserTestBase;
|
||||
|
||||
/**
|
||||
* Tests integrated functionality of the farmOS profile.
|
||||
*
|
||||
* @group farm
|
||||
*/
|
||||
class FarmTest extends BrowserTestBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $profile = 'farm';
|
||||
|
||||
/**
|
||||
* Tests integrated functionality of the farmOS profile.
|
||||
*/
|
||||
public function testFarm() {
|
||||
|
||||
// Test that the profile was installed.
|
||||
$this->assertSame($this->profile, $this->container->getParameter('install_profile'));
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue