GeolocationTest::testRendering()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 18
rs 9.6666
c 0
b 0
f 0
1
<?php
2
/**
3
 * Copyright Andreas Heigl<[email protected]>
4
 *
5
 * Permission is hereby granted, free of charge, to any person obtaining a copy
6
 * of this software and associated documentation files (the "Software"), to deal
7
 * in the Software without restriction, including without limitation the rights
8
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
 * copies of the Software, and to permit persons to whom the Software is
10
 * furnished to do so, subject to the following conditions:
11
 *
12
 * The above copyright notice and this permission notice shall be included in
13
 * all copies or substantial portions of the Software.
14
 *
15
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
 * LIBILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
 * THE SOFTWARE.
22
 *
23
 * @author    Andreas Heigl<[email protected]>
24
 * @copyright Andreas Heigl
25
 * @license   http://www.opesource.org/licenses/mit-license.php MIT-License
26
 * @version   0.0
27
 * @since     29.07.13
28
 * @link      https://github.com/heiglandreas/OrgHeiglGeolocation
29
 */
30
31
namespace Org_Heigl\GeolocationTest\Form\View\Helper;
32
33
use PHPUnit\Framework\TestCase;
34
use Org_Heigl\Geolocation\Form\View\Helper\Geolocation;
35
use Org_Heigl\Geolocation\Form\Element\Geolocation as GeoElement;
36
use Mockery as M;
37
use Zend\View\Helper\HeadLink;
38
use Zend\View\Helper\HeadScript;
39
use Zend\View\Renderer\PhpRenderer;
40
41
class GeolocationTest extends TestCase
42
{
43
    public function testRendering()
44
    {
45
        $this->markTestIncomplete('Has to be implemented fully');
46
47
        $element = M::mock(GeoElement::class);
48
49
        $headScript = M::mock(HeadScript::class);
50
        $headLink   = M::mock(HeadLink::class);
51
        $view       = M::mock(PhpRenderer::class);
52
        $headScript->setView($view);
0 ignored issues
show
Bug introduced by
The method setView() does not seem to exist on object<Mockery\MockInterface>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
53
        $headLink->setView($view);
0 ignored issues
show
Bug introduced by
The method setView() does not seem to exist on object<Mockery\MockInterface>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
54
55
        $renderer = new Geolocation();
56
        $renderer->setView($view);
57
58
        $this->assertEquals('foo', $renderer->render($element));
59
60
    }
61
}