This commit is contained in:
James
2019-11-10 15:02:44 +00:00
parent 5352a3ea37
commit 3fcd44e9ce
9 changed files with 142 additions and 130 deletions

View File

@@ -2,22 +2,22 @@
<?php
// load the config, create the connection and load the repo sepcified on the cmd line args
// we will then have $client and $repo available
require('setup.php');
require 'setup.php';
//get the test label or create if not exist
if(!$label=$repo->getLabelByName('Test')){
$label=$repo->createLabel(['name'=>'Test','color'=>'#336699']);
if (!$label = $repo->getLabelByName('Test')) {
$label = $repo->createLabel(['name' => 'Test', 'color' => '#336699']);
}
//create a test issue
$issue=$repo->createIssue([
'title'=>'Test',
'body'=>'Just testing'
$issue = $repo->createIssue([
'title' => 'Test',
'body' => 'Just testing',
]);
$issue->addLabel($label);
$issue->addComment('Test comment');
$issue->save();
//change the issue body
$issue->body.=' (Edited!)';
$issue->body .= ' (Edited!)';
$issue->save();