File tree 1 file changed +32
-1
lines changed
1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,20 @@ public function testNameByDefaultIsDerivedFromTheNameOfTheClass()
63
63
$ this ->assertEqual ('test-case--test-task001 ' , $ oTask ->getTaskName ());
64
64
}
65
65
66
+ public function testNameByDefaultIsDerivedFromTheNameOfTheClass_withEmptyTaskNamePropertySetsByChildClass ()
67
+ {
68
+ $ task = new Doctrine_Task_TestCase_EmptyTaskNameTestTask ();
69
+
70
+ $ this ->assertEqual ('test-case--empty-task-name-test-task ' , $ task ->getTaskName ());
71
+ }
72
+
73
+ public function testNameUseCustomNameThroughGetTaskNameMethod ()
74
+ {
75
+ $ task = new Doctrine_Task_TestCase_OverwrittenGetTaskNameMethodTestTask ();
76
+
77
+ $ this ->assertEqual ('foo ' , $ task ->getTaskName ());
78
+ }
79
+
66
80
public function testSettasknameSetsTheNameOfTheTask ()
67
81
{
68
82
$ oTask = new Doctrine_Task_TestCase_TestTask002 ();
@@ -154,4 +168,21 @@ class Doctrine_Task_TestCase_TestTask003 extends Doctrine_Task
154
168
public $ taskName = 'better-task-name ' ;
155
169
156
170
public function execute () {}
157
- }
171
+ }
172
+
173
+ class Doctrine_Task_TestCase_EmptyTaskNameTestTask extends Doctrine_Task
174
+ {
175
+ public $ taskName = '' ;
176
+
177
+ public function execute () {}
178
+ }
179
+
180
+ class Doctrine_Task_TestCase_OverwrittenGetTaskNameMethodTestTask extends Doctrine_Task
181
+ {
182
+ public function execute () {}
183
+
184
+ public function getTaskName ()
185
+ {
186
+ return 'foo ' ;
187
+ }
188
+ }
You can’t perform that action at this time.
0 commit comments