1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace ByTIC\Assets\Tests\Assets\Asset\Traits; |
4
|
|
|
|
5
|
|
|
use ByTIC\Assets\Assets\Asset; |
6
|
|
|
use ByTIC\Assets\Tests\AbstractTest; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Class HasContentTraitTest |
10
|
|
|
* @package ByTIC\Assets\Tests\Assets\Asset\Traits |
11
|
|
|
*/ |
12
|
|
|
class HasContentTraitTest extends AbstractTest |
13
|
|
|
{ |
14
|
|
|
public function test_hasContent() |
15
|
|
|
{ |
16
|
|
|
$asset = new Asset('', Asset::TYPE_STYLES); |
17
|
|
|
self::assertFalse($asset->hasContent()); |
18
|
|
|
$asset->setContent('++'); |
19
|
|
|
self::assertTrue($asset->hasContent()); |
20
|
|
|
} |
21
|
|
|
|
22
|
|
|
public function test_appendContent() |
23
|
|
|
{ |
24
|
|
|
$asset = new Asset('', Asset::TYPE_STYLES); |
25
|
|
|
self::assertEmpty($asset->getContent()); |
|
|
|
|
26
|
|
|
|
27
|
|
|
$asset->appendContent('1'); |
28
|
|
|
self::assertSame('1', $asset->getContent()); |
|
|
|
|
29
|
|
|
|
30
|
|
|
$asset->appendContent('2'); |
31
|
|
|
self::assertSame('1'."\r\n".'2', $asset->getContent()); |
|
|
|
|
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function test_prependContent() |
35
|
|
|
{ |
36
|
|
|
$asset = new Asset('', Asset::TYPE_STYLES); |
37
|
|
|
self::assertEmpty($asset->getContent()); |
|
|
|
|
38
|
|
|
|
39
|
|
|
$asset->prependContent('1'); |
40
|
|
|
self::assertSame('1', $asset->getContent()); |
|
|
|
|
41
|
|
|
|
42
|
|
|
$asset->prependContent('2'); |
43
|
|
|
self::assertSame('2'."\r\n".'1', $asset->getContent()); |
|
|
|
|
44
|
|
|
} |
45
|
|
|
} |
46
|
|
|
|
This check looks for function or method calls that always return null and whose return value is used.
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.