Skip to content

Commit c5835e5

Browse files
author
emreakay
committed
- traits fixed
- phpunit and pest fixed
1 parent 767db11 commit c5835e5

File tree

3 files changed

+4
-32
lines changed

3 files changed

+4
-32
lines changed

src/Models/AIssue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Illuminate\Database\Eloquent\Model;
77

88
/**
9-
* @property-read string $status
9+
* @property string $status
1010
* @property-read string $issue_type
1111
*/
1212
class AIssue extends Model

src/Traits/AIssueModelTrait.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public function createIssue(
2626
int $priority,
2727
Carbon $duedate,
2828
): \AuroraWebSoftware\AIssue\Models\AIssue {
29-
3029
// todo issueType Kontrolü
3130
// todo status yetki kontrolü
3231

tests/Unit/AIssueTest.php

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@
1616
$table->timestamps();
1717
});
1818

19-
2019
$mockPolicyFunction = function ($permission): bool {
2120
if ($permission == 'todo_perm' || $permission == 'in_progress_perm') {
2221
return true;
2322
}
23+
2424
return false;
2525
};
2626

2727
Config::set('aissue.policyMethod', $mockPolicyFunction);
28-
2928
});
3029

3130
test('can read aissue config', function () {
@@ -36,8 +35,8 @@
3635
$this->assertTrue(config('aissue')['policyMethod'] instanceof \Closure);
3736
});
3837

39-
test('can access policy method works', function () {
40-
$this->assertTrue(config('aissue')['policyMethod']('test permission'));
38+
test('can access policy method works for todo', function () {
39+
$this->assertTrue(config('aissue')['policyMethod']('todo_perm'));
4140
});
4241

4342
test('can get one specified issue', function () {
@@ -59,9 +58,7 @@
5958
);
6059
});
6160

62-
6361
test('can check make transition for todo', function () {
64-
6562
$createdModel = Issueable::create(
6663
['name' => 'test isuable model 2']
6764
);
@@ -73,7 +70,6 @@
7370
});
7471

7572
test('can check make transition for in_progress', function () {
76-
7773
$createdModel = Issueable::create(
7874
['name' => 'test isuable model 3']
7975
);
@@ -85,7 +81,6 @@
8581
});
8682

8783
test('can check make transition for done', function () {
88-
8984
$createdModel = Issueable::create(
9085
['name' => 'test isuable model 4']
9186
);
@@ -95,25 +90,3 @@
9590

9691
$this->assertFalse($createdIssueModel->canMakeTransition('done'));
9792
});
98-
99-
test('can make transition', function () {
100-
101-
$createdModel = Issueable::create(
102-
['name' => 'test isuable model 1']
103-
);
104-
105-
$createdIssueModel = $createdModel->createIssue(1, 1, 'task', 'test isssue 1', 'asdasd', 1, \Illuminate\Support\Carbon::now());
106-
107-
$createdAissue = $this->aissue->createIssue($this->data);
108-
$transition = $this->aissue->makeTransition($createdAissue, 'todo');
109-
$this->assertTrue($transition->status == 'todo');
110-
});
111-
112-
test('can get transitionable statuses', function () {
113-
$createdAissue = $this->aissue->createIssue($this->data);
114-
$transitionableStatuses = $this->aissue->getTransitionableStatuses($createdAissue);
115-
// $this->assertTrue($transition->status == 'todo');
116-
});
117-
118-
test('x', function () {
119-
});

0 commit comments

Comments
 (0)