Skip to content

Commit 44e44bb

Browse files
committed
test: acceptance iteration crud
1 parent 338397a commit 44e44bb

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/Acceptance/IterationTest.php

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace Tests\Acceptance;
4+
5+
use Coding\Iteration;
6+
7+
class IterationTest extends TestCase
8+
{
9+
public function testCrud()
10+
{
11+
$data = [
12+
'ProjectName' => $this->projectName,
13+
'Name' => $this->faker->sentence(2),
14+
];
15+
16+
$iteration = new Iteration($this->token);
17+
$createResult = $iteration->create($data);
18+
$this->assertTrue(is_numeric($createResult['Code']));
19+
20+
$params = [
21+
'ProjectName' => $this->projectName,
22+
'IterationCode' => $createResult['Code'],
23+
];
24+
$getResult = $iteration->get($params);
25+
$this->assertEquals($createResult['Name'], $getResult['Name']);
26+
27+
$name = $this->faker->sentence(2);
28+
$updateResult = $iteration->update(array_merge($params, [
29+
'Name' => $name,
30+
]));
31+
$this->assertEquals($name, $updateResult['Name']);
32+
33+
$this->assertTrue($iteration->delete($params));
34+
}
35+
}

0 commit comments

Comments
 (0)