Completed
Push — master ( b73efb...175f05 )
by Bukashk0zzz
03:39
created

OfferTourGeneratorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 2
cbo 3
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGenerate() 0 5 1
A createOffer() 0 16 1
1
<?php
2
3
/*
4
 * This file is part of the Bukashk0zzzYmlGenerator
5
 *
6
 * (c) Denis Golubovskiy <[email protected]>
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
namespace Bukashk0zzz\YmlGenerator\Tests;
13
14
use Bukashk0zzz\YmlGenerator\Model\Offer\OfferTour;
15
16
/**
17
 * Generator test
18
 *
19
 * @author Denis Golubovskiy <[email protected]>
20
 */
21
class OfferTourGeneratorTest extends AbstractGeneratorTest
22
{
23
    /**
24
     * Test generate
25
     */
26
    public function testGenerate()
27
    {
28
        $this->offerType = 'Tour';
29
        $this->runGeneratorTest();
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    protected function createOffer()
36
    {
37
        return (new OfferTour())
38
            ->setWorldRegion($this->faker->name)
39
            ->setCountry($this->faker->name)
40
            ->setRegion($this->faker->name)
41
            ->setDays($this->faker->numberBetween(1, 9999))
42
            ->addDataTour($this->faker->date("Y-m-d\TH:i"))
0 ignored issues
show
Documentation introduced by
$this->faker->date('Y-m-d\\TH:i') is of type string, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
43
            ->setName($this->faker->name)
44
            ->setHotelStars($this->faker->name)
45
            ->setRoom($this->faker->name)
46
            ->setMeal($this->faker->name)
47
            ->setIncluded($this->faker->name)
48
            ->setTransport($this->faker->name)
49
        ;
50
    }
51
}
52