MockEmbed::getWidth()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace SilverStripe\AssetAdmin\Tests\Forms\RemoteFileFormFactoryTest;
4
5
use SilverStripe\Dev\TestOnly;
6
use SilverStripe\View\Embed\Embeddable;
7
8
class MockEmbed implements Embeddable, TestOnly
9
{
10
    protected $url;
11
12
    public function __construct($url)
13
    {
14
        $this->url = $url;
15
    }
16
17
    public function getWidth()
18
    {
19
        return 100;
20
    }
21
22
    public function getHeight()
23
    {
24
        return 100;
25
    }
26
27
    public function getPreviewURL()
28
    {
29
        return $this->url;
30
    }
31
32
    /**
33
     * Get human readable name for this resource
34
     *
35
     * @return string
36
     */
37
    public function getName()
38
    {
39
        return 'image';
40
    }
41
42
    /**
43
     * Get Embed type
44
     *
45
     * @return string
46
     */
47
    public function getType()
48
    {
49
        return 'image';
50
    }
51
52
    /**
53
     * Validate this resource
54
     *
55
     * @return bool
56
     */
57
    public function validate()
58
    {
59
        return true;
60
    }
61
}
62