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

OfferTourGeneratorTest::createOffer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 13
nc 1
nop 0
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