Passed
Push — master ( 8a85d8...f1d9cd )
by Alex
10:07
created

CommonApplicationActionsUnitTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 8
dl 0
loc 22
rs 10
c 1
b 0
f 1
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testActionsJson() 0 16 1
1
<?php
2
namespace Mezon\Application\Tests;
3
4
use PHPUnit\Framework\TestCase;
5
use Mezon\Application\CommonApplication;
6
use Mezon\HtmlTemplate\HtmlTemplate;
7
use Mezon\Application\View;
8
9
class CommonApplicationActionsUnitTest extends TestCase
10
{
11
12
    /**
13
     * Running with actions
14
     */
15
    public function testActionsJson()
16
    {
17
        // setup
18
        $application = new TestCommonApplication();
19
20
        // test body
21
        $result = $application->actionFromConfig();
0 ignored issues
show
Bug introduced by
The method actionFromConfig() does not exist on Mezon\Application\Tests\TestCommonApplication. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

21
        /** @scrutinizer ignore-call */ 
22
        $result = $application->actionFromConfig();
Loading history...
22
23
        // assertions
24
        $this->assertArrayHasKey('title', $result);
25
        $this->assertEquals('Some title', $result['title']);
26
27
        $this->assertArrayHasKey('main', $result);
28
        $this->assertInstanceOf(View::class, $result['main']);
29
30
        $this->assertTrue(TestingPresenter::$actionPresenterFromConfigWasCalled);
31
    }
32
}
33