Completed
Pull Request — master (#4)
by Laurens
02:47
created

BaseReportTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 3
c 3
b 0
f 0
lcom 1
cbo 3
dl 0
loc 29
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testSetFormat() 0 8 1
A testSetReturnOnlyCompleteData() 0 8 1
A testSetReportLanguage() 0 8 1
1
<?php
2
3
namespace Tests\Werkspot\BingAdsApiBundle\Tests\Api\Report;
4
5
use BingAds\Reporting\ReportFormat;
6
use BingAds\Reporting\ReportLanguage;
7
use PHPUnit_Framework_TestCase;
8
use Werkspot\BingAdsApiBundle\Api\Report\BaseReport;
9
10
class BaseReportTest extends PHPUnit_Framework_TestCase
11
{
12
    public function testSetFormat()
13
    {
14
        $report = new BaseReport();
15
        $this->assertNull($report->getRequest()->Format);
16
        /* @var string (See BingAds SDK documentation) */
17
        $report->setFormat(ReportFormat::Csv);
18
        $this->assertEquals(ReportFormat::Csv, $report->getRequest()->Format);
19
    }
20
21
    public function testSetReturnOnlyCompleteData()
22
    {
23
        $report = new BaseReport();
24
        $this->assertNull($report->getRequest()->ReturnOnlyCompleteData);
25
26
        $report->setReturnOnlyCompleteData(true);
27
        $this->assertTrue($report->getRequest()->ReturnOnlyCompleteData);
28
    }
29
30
    public function testSetReportLanguage()
31
    {
32
        $report = new BaseReport();
33
        $this->assertNull($report->getRequest()->Language);
34
35
        $report->setReportLanguage(ReportLanguage::English);
36
        $this->assertEquals(ReportLanguage::English, $report->getRequest()->Language);
37
    }
38
}
39