Passed
Pull Request — master (#59)
by Raúl
04:04
created

ProductTest::testSetQuantity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
1
<?php
2
3
namespace Test\Pagantis\OrdersApiClient\Model\Order\ShoppingCart\Details;
4
5
use Faker\Factory;
6
use Pagantis\OrdersApiClient\Model\Order\ShoppingCart\Details\Product;
7
use Test\Pagantis\OrdersApiClient\AbstractTest;
8
9
/**
10
 * Class Product
11
 * @package Test\Pagantis\OrdersApiClient\Model\Order\ShoppingCart\Details
12
 */
13
class ProductTest extends AbstractTest
14
{
15
    /**
16
     * testSetAmount
17
     */
18
    public function testSetAmount()
19
    {
20
        $faker = Factory::create();
21
        $number = $faker->randomDigitNotNull;
22
        $product = new Product();
23
        $product->setQuantity($number);
24
        $this->assertEquals($product->getQuantity(), $number);
25
    }
26
27
    /**
28
     * testSetDescription
29
     */
30
    public function testSetDescription()
31
    {
32
        $faker = Factory::create();
33
        $sentence = $faker->sentence;
34
        $product = new Product();
35
        $product->setDescription($sentence);
36
        $this->assertEquals($product->getDescription(), $sentence);
37
        $product->setDescription(null);
38
        $this->assertEquals(null, $product->getDescription());
39
    }
40
41
    /**
42
     * testSetQuantity
43
     */
44
    public function testSetQuantity()
45
    {
46
        $faker = Factory::create();
47
        $number = $faker->randomDigitNotNull;
48
        $product = new Product();
49
        $product->setQuantity($number);
50
        $this->assertEquals($product->getQuantity(), $number);
51
    }
52
}
53