aircargobook / phpunit-jira-connect
a simple php trait to push test results (per issue) to JRIA.
Installs: 4 756
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- chobie/jira-api-restclient: ^2.0@dev
This package is auto-updated.
Last update: 2025-03-07 03:02:44 UTC
README
Adds info to jira tickets if tests were successful or not.
install
composer require aircargobook/phpunit-jira-connect
jira setup
In order for Jira to store data for every issue, we need to add a custom field. To do that, go to Settings and add new custom field, Tests..
https://YOUR_JIRA_URL.atlassian.net/secure/admin/ViewCustomFields.jspa
usage
Add this to your tests/bootstrap.php
/* load custom jira trait */
define('JIRA_URL', 'https://YOUR_JIRA_URL.atlassian.net');
define('JIRA_LOGIN', 'YOUR_EMAIL');
define('JIRA_PASS', 'YOUR_PASSWORD');
define('UPDATE_JIRA_TEST_STATUS', true);
/* end of loading custom jira trait */
Then link any testcase you where you want to use the trait
<?php
namespace App\Test\TestCase\Controller;
use Aircargobook\PhpunitJiraConnect\Traits\JiraConnectTrait;
use Cake\TestSuite\IntegrationTestCase;
class ExampleControllerTest extends IntegrationTestCase
{
use JiraConnectTrait;
...
Now you can continue linking your issues with the tests:
linking tests to issues
just put this on top of the test you wrote
/**
* @test
*
* @ticket ACB-18
*
* @return void
*/
Inspired by this article, I found some day somewhere linked on a blog: https://kurapov.ee/eng/qa/jira_connect_ticket_annotations/