Completed
Push — 1.0 ( 5f7e14...62fb10 )
by Kamil
35:39
created

DashboardStatisticsSpec::let()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace spec\Sylius\Component\Core\Dashboard;
15
16
use PhpSpec\ObjectBehavior;
17
18
final class DashboardStatisticsSpec extends ObjectBehavior
19
{
20
    function let(): void
21
    {
22
        $this->beConstructedWith(2564, 24, 10);
23
    }
24
25
    function it_has_total_sales_stat(): void
26
    {
27
        $this->getTotalSales()->shouldReturn(2564);
28
    }
29
30
    function it_has_new_orders_stat(): void
31
    {
32
        $this->getNumberOfNewOrders()->shouldReturn(24);
33
    }
34
35
    function ith_has_new_customers_stat(): void
36
    {
37
        $this->getNumberOfNewCustomers()->shouldReturn(10);
38
    }
39
40
    function it_calculates_an_average_order_value(): void
41
    {
42
        $this->getAverageOrderValue()->shouldReturn(107);
43
    }
44
45
    function it_returns_0_as_average_order_value_when_there_are_no_orders(): void
46
    {
47
        $this->beConstructedWith(0, 0, 2);
48
49
        $this->getAverageOrderValue()->shouldReturn(0);
50
    }
51
}
52