Test Failed
Push — master ( 440ce5...0cdbc1 )
by Siad
07:01
created

ApplyTaskTest::testPropertySetCheckReturn()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/*
3
 *
4
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
 *
16
 * This software consists of voluntary contributions made by many individuals
17
 * and is licensed under the LGPL. For more information please see
18
 * <http://phing.info>.
19
 */
20
21
/**
22
 * Tests the Apply Task
23
 *
24
 * @author  Utsav Handa <handautsav at hotmail dot com>
25
 * @package phing.tasks.system
26
 */
27
class ApplyTaskTest extends BuildFileTest
28
{
29
    /**
30
     * Whether test is being run on windows
31
     * @var bool
32
     */
33
    protected $windows;
34
35
    /**
36
     * Setup the test
37
     */
38
    public function setUp(): void
39
    {
40
        // Tests definitions
41
        $this->configureProject(PHING_TEST_BASE . '/etc/tasks/system/ApplyTest.xml');
0 ignored issues
show
Bug introduced by
The constant PHING_TEST_BASE was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
42
43
        // Identifying the running environment
44
        $this->windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
45
    }
46
47
    /**********************************************************************************/
48
    /************************************** T E S T S *********************************/
49
    /**********************************************************************************/
50
51
    /**
52
     * Tests the OS configuration setting
53
     */
54
    public function testPropertySetOs()
55
    {
56
        $this->assertAttributeIsSetTo('os', 'linux');
57
    }
58
59
    /**
60
     * Tests the dir configuration setting
61
     */
62
    public function testPropertySetDir()
63
    {
64
        $this->assertAttributeIsSetTo('dir', new PhingFile($this->project->getProperty('php.tmpdir')));
65
    }
66
67
    /**
68
     * Tests the escape configuration setting
69
     */
70
    public function testPropertySetEscape()
71
    {
72
        $this->assertAttributeIsSetTo('escape', true);
0 ignored issues
show
Bug introduced by
true of type true is incompatible with the type string expected by parameter $value of ApplyTaskTest::assertAttributeIsSetTo(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

72
        $this->assertAttributeIsSetTo('escape', /** @scrutinizer ignore-type */ true);
Loading history...
73
    }
74
75
    /**
76
     * Tests the pass-thru configuration setting
77
     */
78
    public function testPropertySetPassthru()
79
    {
80
        $this->assertAttributeIsSetTo('passthru', true);
0 ignored issues
show
Bug introduced by
true of type true is incompatible with the type string expected by parameter $value of ApplyTaskTest::assertAttributeIsSetTo(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

80
        $this->assertAttributeIsSetTo('passthru', /** @scrutinizer ignore-type */ true);
Loading history...
81
    }
82
83
    /**
84
     * Tests the spawn configuration setting
85
     */
86
    public function testPropertySetSpawn()
87
    {
88
        $this->assertAttributeIsSetTo('spawn', true);
0 ignored issues
show
Bug introduced by
true of type true is incompatible with the type string expected by parameter $value of ApplyTaskTest::assertAttributeIsSetTo(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

88
        $this->assertAttributeIsSetTo('spawn', /** @scrutinizer ignore-type */ true);
Loading history...
89
    }
90
91
    /**
92
     * Tests the returnProperty configuration setting
93
     */
94
    public function testPropertySetReturnProperty()
95
    {
96
        $this->assertAttributeIsSetTo('returnProperty', 'retval');
97
    }
98
99
    /**
100
     * Tests the outputProperty configuration setting
101
     */
102
    public function testPropertySetOutputProperty()
103
    {
104
        $this->assertAttributeIsSetTo('outputProperty', 'outval');
105
    }
106
107
    /**
108
     * Tests the checkReturn/failonerror configuration setting
109
     */
110
    public function testPropertySetCheckReturn()
111
    {
112
        $this->assertAttributeIsSetTo('checkreturn', true);
0 ignored issues
show
Bug introduced by
true of type true is incompatible with the type string expected by parameter $value of ApplyTaskTest::assertAttributeIsSetTo(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

112
        $this->assertAttributeIsSetTo('checkreturn', /** @scrutinizer ignore-type */ true);
Loading history...
113
    }
114
115
    /**
116
     * Tests the output configuration setting
117
     */
118
    public function testPropertySetOutput()
119
    {
120
        $this->assertAttributeIsSetTo('output',
121
            new PhingFile($this->project->getProperty('php.tmpdir') . '/outputfilename'));
122
    }
123
124
    /**
125
     * Tests the error configuration setting
126
     */
127
    public function testPropertySetError()
128
    {
129
        $this->assertAttributeIsSetTo('error',
130
            new PhingFile($this->project->getProperty('php.tmpdir') . '/errorfilename'));
131
    }
132
133
    /**
134
     * Tests the append configuration setting
135
     */
136
    public function testPropertySetAppend()
137
    {
138
        $this->assertAttributeIsSetTo('append', true, 'appendoutput');
0 ignored issues
show
Bug introduced by
true of type true is incompatible with the type string expected by parameter $value of ApplyTaskTest::assertAttributeIsSetTo(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

138
        $this->assertAttributeIsSetTo('append', /** @scrutinizer ignore-type */ true, 'appendoutput');
Loading history...
139
    }
140
141
    /**
142
     * Tests the parallel configuration setting
143
     */
144
    public function testPropertySetParallel()
145
    {
146
        $this->assertAttributeIsSetTo('parallel', false);
0 ignored issues
show
Bug introduced by
false of type false is incompatible with the type string expected by parameter $value of ApplyTaskTest::assertAttributeIsSetTo(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

146
        $this->assertAttributeIsSetTo('parallel', /** @scrutinizer ignore-type */ false);
Loading history...
147
    }
148
149
    /**
150
     * Tests the addsourcefile configuration setting
151
     */
152
    public function testPropertySetAddsourcefile()
153
    {
154
        $this->assertAttributeIsSetTo('addsourcefile', false);
0 ignored issues
show
Bug introduced by
false of type false is incompatible with the type string expected by parameter $value of ApplyTaskTest::assertAttributeIsSetTo(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

154
        $this->assertAttributeIsSetTo('addsourcefile', /** @scrutinizer ignore-type */ false);
Loading history...
155
    }
156
157
    /**
158
     * Tests the relative configuration setting
159
     */
160
    public function testPropertySetRelative()
161
    {
162
        $this->assertAttributeIsSetTo('relative', false);
0 ignored issues
show
Bug introduced by
false of type false is incompatible with the type string expected by parameter $value of ApplyTaskTest::assertAttributeIsSetTo(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

162
        $this->assertAttributeIsSetTo('relative', /** @scrutinizer ignore-type */ false);
Loading history...
163
    }
164
165
    /**
166
     * Tests the forwardslash configuration setting
167
     */
168
    public function testPropertySetForwardslash()
169
    {
170
        $this->assertAttributeIsSetTo('forwardslash', true);
0 ignored issues
show
Bug introduced by
true of type true is incompatible with the type string expected by parameter $value of ApplyTaskTest::assertAttributeIsSetTo(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

170
        $this->assertAttributeIsSetTo('forwardslash', /** @scrutinizer ignore-type */ true);
Loading history...
171
    }
172
173
    /**
174
     * Tests the maxparallel configuration setting
175
     */
176
    public function testPropertySetMaxparallel()
177
    {
178
        $this->assertAttributeIsSetTo('maxparallel', 10);
179
    }
180
181
    /**
182
     * Tests the OS execution for the unspecified OS
183
     */
184
    public function testDoNotExecuteOnWrongOs()
185
    {
186
187
        // Process
188
        $this->executeTarget(__FUNCTION__);
189
        $this->assertInLogs('was not found in the specified list of valid OSes: unknownos');
190
191
        $this->assertNotContains('this should not be executed', $this->getOutput());
192
    }
193
194
    /**
195
     * Tests the OS execution for the specified OS list
196
     */
197
    public function testExecuteOnCorrectOs()
198
    {
199
        $this->executeTarget(__FUNCTION__);
200
        $this->assertInLogs('this should be executed');
201
    }
202
203
    /**
204
     * Tests the dir changing on a non-existent directory
205
     */
206
    public function testFailOnNonExistingDir()
207
    {
208
        $nonExistentDir = $this->project->getProperty('php.tmpdir') . DIRECTORY_SEPARATOR
209
            . 'non' . DIRECTORY_SEPARATOR
210
            . 'existent' . DIRECTORY_SEPARATOR
211
            . 'dir';
212
213
        return $this->expectBuildExceptionContaining(
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->expectBuildExcept...not a valid directory') targeting BuildFileTest::expectBuildExceptionContaining() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
214
            __FUNCTION__,
215
            __FUNCTION__,
216
            "'$nonExistentDir' is not a valid directory"
217
        );
218
    }
219
220
    /**
221
     * Tests the dir changing on an existent directory
222
     */
223
    public function testChangeToDir()
224
    {
225
226
        // Validating the OS platform
227
        if ($this->windows) {
228
            $this->markTestSkipped("Windows does not have 'ls'");
229
        }
230
231
        $this->executeTarget(__FUNCTION__);
232
        $this->assertInLogs('Working directory change successful');
233
    }
234
235
    /**
236
     * Tests the failonerror/checkreturn value for 'true'
237
     */
238
    public function testCheckreturnTrue()
239
    {
240
241
        // Validating the OS platform
242
        if ($this->windows) {
243
            $this->markTestSkipped("Windows does not have '/bin/true'");
244
        }
245
246
        $this->executeTarget(__FUNCTION__);
247
        $this->assertTrue(true);
248
    }
249
250
    /**
251
     * Tests the failonerror/checkreturn value for 'false'
252
     */
253
    public function testCheckreturnFalse()
254
    {
255
256
        // Validating the OS platform
257
        if ($this->windows) {
258
            $this->markTestSkipped("Windows does not have '/bin/false'");
259
        }
260
261
        return $this->expectBuildExceptionContaining(__FUNCTION__, __FUNCTION__, 'Task exited with code (1)');
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->expectBuildExcept... exited with code (1)') targeting BuildFileTest::expectBuildExceptionContaining() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
262
    }
263
264
    /**
265
     * Tests the outputProperty setting
266
     */
267
    public function testOutputProperty()
268
    {
269
        $this->executeTarget(__FUNCTION__);
270
        $this->assertInLogs('The output property\'s value is: "foo"');
271
    }
272
273
    /**
274
     * Tests the returnProperty setting
275
     */
276
    public function testReturnProperty()
277
    {
278
        $this->executeTarget(__FUNCTION__);
279
        $this->assertInLogs('The return property\'s value is: "1"');
280
    }
281
282
    /**
283
     * Tests the command escaping for execution
284
     */
285
    public function testEscape()
286
    {
287
        $this->executeTarget(__FUNCTION__);
288
        $this->assertInLogs(
289
            $this->windows
290
                ? (escapeshellarg('echo') . ' ' . escapeshellarg('foo') . " " . escapeshellarg('|') . " " . escapeshellarg('cat'))
291
                : ("'echo' 'foo' '|' 'cat'"));
292
    }
293
294
    /**
295
     * Tests the command execution with 'passthru' function
296
     */
297
    public function testPassThru()
298
    {
299
        $this->executeTarget(__FUNCTION__);
300
        $this->assertInLogs('Executing command:');
301
    }
302
303
    /**
304
     * Tests the output file functionality
305
     */
306
    public function testOutput()
307
    {
308
309
        // Getting a temp. file
310
        $tempfile = tempnam(sys_get_temp_dir(), 'phing-exectest-');
311
312
        // Setting the property
313
        $this->project->setProperty('execTmpFile', $tempfile);
314
        $this->executeTarget(__FUNCTION__);
315
316
        // Validating the output
317
        $output = @file_get_contents($tempfile);
318
        @unlink($tempfile);
1 ignored issue
show
Security Best Practice introduced by
It seems like you do not handle an error condition for unlink(). This can introduce security issues, and is generally not recommended. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unhandled  annotation

318
        /** @scrutinizer ignore-unhandled */ @unlink($tempfile);

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
319
        $this->assertEquals('outfoo', rtrim($output));
320
    }
321
322
    /**
323
     * Tests the error file functionality
324
     */
325
    public function testError()
326
    {
327
328
        // Validating the OS platform
329
        if ($this->windows) {
330
            $this->markTestSkipped("The script is unlikely to run on MS Windows");
331
        }
332
333
        // Getting a temp. file
334
        $tempfile = tempnam(sys_get_temp_dir(), 'phing-exectest-');
335
336
        $scriptFile = getcwd() . "/error_output.sh";
337
        file_put_contents($scriptFile, "echo errfoo 1>&2");
338
        chmod($scriptFile, 0744);
339
340
        // Setting the property
341
        $this->project->setProperty('executable', $scriptFile);
342
        $this->project->setProperty('execTmpFile', $tempfile);
343
        $this->executeTarget(__FUNCTION__);
344
345
        // Validating the output
346
        $output = @file_get_contents($tempfile);
347
        @unlink($tempfile);
1 ignored issue
show
Security Best Practice introduced by
It seems like you do not handle an error condition for unlink(). This can introduce security issues, and is generally not recommended. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unhandled  annotation

347
        /** @scrutinizer ignore-unhandled */ @unlink($tempfile);

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
348
        @unlink($scriptFile);
349
        $this->assertEquals("errfoo", rtrim($output));
350
    }
351
352
    /**
353
     * Tests the execution with the background process spawning
354
     */
355
    public function testSpawn()
356
    {
357
        // Validating the OS platform
358
        if ($this->windows) {
359
            $this->markTestSkipped("Windows does not have /bin/sleep");
360
        }
361
362
        // Process
363
        $start = time();
364
        $this->executeTarget(__FUNCTION__);
365
        $end = time();
366
        $this->assertLessThan(
367
            4,
368
            ($end - $start),
369
            'Execution time should be lower than 4 seconds, otherwise spawning did not work'
370
        );
371
    }
372
373
    /**
374
     * Tests the nested arguments specified for the execution
375
     */
376
    public function testNestedArgs()
377
    {
378
        $this->executeTarget(__FUNCTION__);
379
        $this->assertInLogs('echo Hello World');
380
    }
381
382
    /**
383
     * Tests the missing/unspecified executable information
384
     */
385
    public function testMissingExecutable()
386
    {
387
        $this->expectBuildExceptionContaining(__FUNCTION__, __FUNCTION__, 'Please provide "executable" information');
388
    }
389
390
    /**
391
     * Tests the escape functionality for special characters in argument
392
     */
393
    public function testEscapedArg()
394
    {
395
        $this->executeTarget(__FUNCTION__);
396
        $this->assertPropertyEquals('outval', $this->windows ? 'abc$b3 SB' : 'abc$b3!SB');
397
    }
398
399
    /**
400
     * Tests the relative source filenames functionality
401
     */
402
    public function testRelativeSourceFilenames()
403
    {
404
        // Validating the OS platform
405
        if ($this->windows) {
406
            $this->markTestSkipped("Windows does not have 'ls'");
407
        }
408
409
        $this->executeTarget(__FUNCTION__);
410
        $this->assertNotInLogs('/etc/');
411
    }
412
413
    /**
414
     * Tests the source filename addition functionality
415
     */
416
    public function testSourceFilename()
417
    {
418
419
        // Validating the OS platform
420
        if ($this->windows) {
421
            $this->markTestSkipped("Windows does not have 'ls'");
422
        }
423
424
        $this->executeTarget(__FUNCTION__);
425
        // As the addsourcefilename is 'off', only the executable should be processed in the execution
426
        $this->assertInLogs('Executing command: ls');
427
    }
428
429
    /**
430
     * Tests the output file append functionality
431
     */
432
    public function testOutputAppend()
433
    {
434
435
        // Getting a temp. file
436
        $tempfile = tempnam(sys_get_temp_dir(), 'phing-exectest-');
437
438
        // Setting the property
439
        $this->project->setProperty('execTmpFile', $tempfile);
440
        $this->executeTarget(__FUNCTION__);
441
442
        // Validating the output
443
        $output = @file_get_contents($tempfile);
444
        @unlink($tempfile);
1 ignored issue
show
Security Best Practice introduced by
It seems like you do not handle an error condition for unlink(). This can introduce security issues, and is generally not recommended. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unhandled  annotation

444
        /** @scrutinizer ignore-unhandled */ @unlink($tempfile);

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
445
        $this->assertEquals($this->windows ? "Append OK \r\nAppend OK" : "Append OK\nAppend OK", rtrim($output));
446
    }
447
448
    /**
449
     * Tests the parallel configuration
450
     */
451
    public function testParallel()
452
    {
453
        $this->executeTarget(__FUNCTION__);
454
        $messages = [];
455
        foreach ($this->logBuffer as $log) {
456
            $messages[] = $log['message'];
457
        }
458
        $this->assertEquals(1, substr_count(implode("\n", $messages), 'Executing command:'));
459
    }
460
461
    public function testMapperSupport()
462
    {
463
        // Getting a temp. file
464
        $tempfile = tempnam(sys_get_temp_dir(), 'phing-exectest-');
465
466
        // Setting the property
467
        $this->project->setProperty('execTmpFile', $tempfile);
468
469
        $this->executeTarget(__FUNCTION__);
470
        $messages = [];
471
        foreach ($this->logBuffer as $log) {
472
            $messages[] = $log['message'];
473
        }
474
        $this->assertContains('Applied echo to 4 files and 0 directories.', $messages);
475
    }
476
477
478
    /**********************************************************************************/
479
    /************************** H E L P E R  M E T H O D S ****************************/
480
    /**********************************************************************************/
481
482
    /**
483
     * @param  string $name
484
     * @return Target
485
     * @throws Exception
486
     */
487
    protected function getTargetByName($name)
488
    {
489
        foreach ($this->project->getTargets() as $target) {
490
            if ($target->getName() == $name) {
491
                return $target;
492
            }
493
        }
494
        throw new Exception(sprintf('Target "%s" not found', $name));
495
    }
496
497
    /**
498
     * @param  string $target
499
     * @param  string $taskName
500
     * @param  int $pos
501
     * @return Task
502
     * @throws Exception
503
     */
504
    protected function getTaskFromTarget($target, $taskName, $pos = 0)
505
    {
506
        $rchildren = new ReflectionProperty(get_class($target), 'children');
0 ignored issues
show
Bug introduced by
$target of type string is incompatible with the type object expected by parameter $object of get_class(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

506
        $rchildren = new ReflectionProperty(get_class(/** @scrutinizer ignore-type */ $target), 'children');
Loading history...
507
        $rchildren->setAccessible(true);
508
        $n = -1;
509
        foreach ($rchildren->getValue($target) as $child) {
0 ignored issues
show
Bug introduced by
$target of type string is incompatible with the type object expected by parameter $object of ReflectionProperty::getValue(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

509
        foreach ($rchildren->getValue(/** @scrutinizer ignore-type */ $target) as $child) {
Loading history...
510
            if ($child instanceof Task && ++$n == $pos) {
511
                return $child;
512
            }
513
        }
514
515
        throw new Exception(sprintf('%s #%d not found in task', $taskName, $pos));
516
    }
517
518
    /**
519
     * @param  string $target
520
     * @param  string $task
521
     * @return Task
522
     */
523
    protected function getConfiguredTask($target, $task)
524
    {
525
        $target = $this->getTargetByName($target);
526
        $task = $this->getTaskFromTarget($target, $task);
527
        $task->maybeConfigure();
528
529
        if ($task instanceof UnknownElement) {
530
            return $task->getRuntimeConfigurableWrapper()->getProxy();
531
        }
532
533
        return $task;
534
    }
535
536
    /**
537
     * @param string $property
538
     * @param string $value
539
     * @param string $propertyName
540
     */
541
    protected function assertAttributeIsSetTo($property, $value, $propertyName = null)
542
    {
543
        $task = $this->getConfiguredTask('testPropertySet' . ucfirst($property), 'ApplyTask');
544
545
        $propertyName = ($propertyName === null) ? $property : $propertyName;
546
        $rprop = new ReflectionProperty('ApplyTask', $propertyName);
547
        $rprop->setAccessible(true);
548
        $this->assertEquals($value, $rprop->getValue($task));
549
    }
550
}
551