Completed
Push — master ( 446c01...fcb59d )
by Ruud
113:27 queued 101:23
created

Tests/unit/Entity/AnalyticsOverviewTest.php (3 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Kunstmaan\ConfigBundle\Tests\Entity;
4
5
use Kunstmaan\DashboardBundle\Entity\AnalyticsGoal;
6
use Kunstmaan\DashboardBundle\Entity\AnalyticsOverview;
7
use PHPUnit\Framework\TestCase;
8
9
class AnalyticsOverviewTest extends TestCase
10
{
11
    public function testGettersAndSetters()
12
    {
13
        $goal = new AnalyticsGoal();
14
        $goal->setVisits(500);
15
16
        $entity = new AnalyticsOverview();
17
        $entity->setTitle('Donald Trump');
18
        $entity->setConfig(5);
19
        $entity->setStartOffset(6);
20
        $entity->setTimespan(7);
21
        $entity->setSessions(8);
22
        $entity->setUsers(9);
23
        $entity->setPageviews(10);
24
        $entity->setPagesPerSession(11);
25
        $entity->setAvgSessionDuration(12);
26
        $entity->setUseYear(2017);
27
        $entity->setChartDataMaxValue(13);
28
        $entity->setSegment(14);
29
        $entity->setReturningUsers(15);
30
        $entity->setNewUsers(1.23);
31
        $entity->setChartData([]);
32
        $entity->setGoals([$goal]);
33
34
        $this->assertEquals('Donald Trump', $entity->getTitle());
35
        $this->assertEquals(5, $entity->getConfig());
36
        $this->assertEquals(6, $entity->getStartOffset());
37
        $this->assertEquals(7, $entity->getTimespan());
38
        $this->assertEquals(8, $entity->getSessions());
39
        $this->assertEquals(9, $entity->getUsers());
40
        $this->assertEquals(10, $entity->getPageviews());
41
        $this->assertEquals(11, $entity->getPagesPerSession());
42
        $this->assertEquals(12, $entity->getAvgSessionDuration());
43
        $this->assertEquals(2017, $entity->getUseYear());
44
        $this->assertEquals(13, $entity->getChartDataMaxValue());
45
        $this->assertEquals(14, $entity->getSegment());
46
        $this->assertEquals(15, $entity->getReturningUsers());
47
        $this->assertEquals(1.23, $entity->getNewUsers());
48
        $this->assertInternalType('array', $entity->getChartData());
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit\Framework\Assert::assertInternalType() has been deprecated with message: https://github.com/sebastianbergmann/phpunit/issues/3369

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
49
        $this->assertInternalType('array', $entity->getGoals());
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit\Framework\Assert::assertInternalType() has been deprecated with message: https://github.com/sebastianbergmann/phpunit/issues/3369

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
50
        $this->assertEquals(188, $entity->getReturningUsersPercentage());
51
        $this->assertEquals(15.0, $entity->getNewUsersPercentage());
52
        $this->assertInternalType('array', $entity->getActiveGoals());
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit\Framework\Assert::assertInternalType() has been deprecated with message: https://github.com/sebastianbergmann/phpunit/issues/3369

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
53
    }
54
}
55