Skip to content
Snippets Groups Projects
Commit a96e94cf authored by Jonathan Smith's avatar Jonathan Smith
Browse files

Issue #3506676 by jonathan1055: Add a phpunit test

parent 19ceb56d
Branches
Tags
1 merge request!5#3506676 Add PHPUNIT tests
Pipeline #436902 passed
......@@ -77,3 +77,14 @@ phpcs:
cp -v .gitlab/phpcs-ok.xml phpcs.xml.dist
cp -v .gitlab/phpcs-ok.xml phpcs.xml.old
fi
phpunit:
before_script:
- echo "BEFORE_SCRIPT_ACTIONS = $BEFORE_SCRIPT_ACTIONS"
- |
if [[ $BEFORE_SCRIPT_ACTIONS =~ "phpunit-fail" ]]; then
echo "Executing phpunit-fail"
cd $CI_PROJECT_DIR && pwd
sed -i "s#assertTrue(TRUE#assertTrue(FALSE#g" tests/src/Functional/GitlabTemplatesDownstreamTest.php
cat tests/src/Functional/GitlabTemplatesDownstreamTest.php
fi
<?php
namespace Drupal\Tests\gitlab_templates_downstream\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* Downstream tests.
*
* @group gtd1
*/
class GitlabTemplatesDownstreamOneTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* A simple test.
*/
public function testDownstream() {
$this->assertTrue(TRUE, 'The basic truth is being tested!');
}
}
<?php
namespace Drupal\Tests\gitlab_templates_downstream\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* Downstream tests.
*
* @group gtd2
*/
class GitlabTemplatesDownstreamTwoTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* A simple test.
*/
public function testDownstream() {
$this->assertFalse(FALSE, 'The lie is being detected!');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment