@@ -10,8 +10,6 @@ class IterationTest extends TestCase
10
10
{
11
11
public function testCreateSuccessWithOnlyRequiredParams ()
12
12
{
13
- $ coreMock = \Mockery::mock (Core::class, [])->makePartial ();
14
-
15
13
$ response = json_decode (
16
14
file_get_contents ($ this ->dataPath ('CreateIterationResponse.json ' )),
17
15
true
@@ -20,20 +18,18 @@ public function testCreateSuccessWithOnlyRequiredParams()
20
18
'ProjectName ' => $ this ->projectName ,
21
19
'Name ' => $ this ->faker ->title ,
22
20
];
23
- $ coreMock ->shouldReceive ('request ' )->times (1 )->withArgs ([
21
+ $ this -> coreMock ->shouldReceive ('request ' )->times (1 )->withArgs ([
24
22
'CreateIteration ' ,
25
23
$ data
26
24
])->andReturn ($ response );
27
25
28
- $ iteration = new Iteration ($ this ->token , $ coreMock );
26
+ $ iteration = new Iteration ($ this ->token , $ this -> coreMock );
29
27
$ result = $ iteration ->create ($ data );
30
28
$ this ->assertEquals ($ response ['Iteration ' ], $ result );
31
29
}
32
30
33
31
public function testCreateSuccessWithRequiredParamsAndNull ()
34
32
{
35
- $ coreMock = \Mockery::mock (Core::class, [])->makePartial ();
36
-
37
33
$ response = json_decode (
38
34
file_get_contents ($ this ->dataPath ('CreateIterationResponse.json ' )),
39
35
true
@@ -43,20 +39,18 @@ public function testCreateSuccessWithRequiredParamsAndNull()
43
39
'Name ' => $ this ->faker ->title ,
44
40
'Goal ' => null ,
45
41
];
46
- $ coreMock ->shouldReceive ('request ' )->times (1 )->withArgs ([
42
+ $ this -> coreMock ->shouldReceive ('request ' )->times (1 )->withArgs ([
47
43
'CreateIteration ' ,
48
44
$ data
49
45
])->andReturn ($ response );
50
46
51
- $ iteration = new Iteration ($ this ->token , $ coreMock );
47
+ $ iteration = new Iteration ($ this ->token , $ this -> coreMock );
52
48
$ result = $ iteration ->create ($ data );
53
49
$ this ->assertEquals ($ response ['Iteration ' ], $ result );
54
50
}
55
51
56
52
public function testCreateSuccessWithAllParams ()
57
53
{
58
- $ coreMock = \Mockery::mock (Core::class, [])->makePartial ();
59
-
60
54
$ response = json_decode (
61
55
file_get_contents ($ this ->dataPath ('CreateIterationResponse.json ' )),
62
56
true
@@ -70,12 +64,12 @@ public function testCreateSuccessWithAllParams()
70
64
'StartAt ' => $ startAt ,
71
65
'EndAt ' => date ('Y-m-d ' , strtotime ($ startAt ) + $ this ->faker ->randomDigitNotZero () * 86400 ),
72
66
];
73
- $ coreMock ->shouldReceive ('request ' )->times (1 )->withArgs ([
67
+ $ this -> coreMock ->shouldReceive ('request ' )->times (1 )->withArgs ([
74
68
'CreateIteration ' ,
75
69
$ data
76
70
])->andReturn ($ response );
77
71
78
- $ iteration = new Iteration ('' , $ coreMock );
72
+ $ iteration = new Iteration ('' , $ this -> coreMock );
79
73
$ iteration ->setToken ($ this ->token );
80
74
$ result = $ iteration ->create ($ data );
81
75
$ this ->assertEquals ($ response ['Iteration ' ], $ result );
0 commit comments