Code Duplication    Length = 12-16 lines in 2 locations

tests/CheckPromocodeValidationTest.php 1 location

@@ 59-70 (lines=12) @@
56
    }
57
58
    /** @test */
59
    public function it_returns_promocode_model_if_validation_passes()
60
    {
61
        $promocodes = Promocodes::create();
62
        $promocode = $promocodes->first();
63
64
        $this->assertCount(1, $promocodes);
65
66
        $checkPromocode = Promocodes::check($promocode['code']);
67
68
        $this->assertTrue($checkPromocode instanceof Promocode);
69
        $this->assertEquals($promocode['code'], $checkPromocode->code);
70
    }
71
72
    /** @test */
73
    public function it_returns_false_if_promocode_exceeds_quantity()

tests/ApplyPromocodeToUserTest.php 1 location

@@ 73-88 (lines=16) @@
70
    }
71
72
    /** @test */
73
    public function is_returns_promocode_with_user_if_applied_successfuly()
74
    {
75
        $user = User::find(1);
76
        $this->actingAs($user);
77
78
        $promocodes = Promocodes::create();
79
        $promocode = $promocodes->first();
80
81
        $this->assertCount(1, $promocodes);
82
83
        $appliedPromocode = Promocodes::apply($promocode['code']);
84
85
        $this->assertTrue($appliedPromocode instanceof Promocode);
86
87
        $this->assertCount(1, $appliedPromocode->users);
88
    }
89
90
    /** @test */
91
    public function it_has_alias_named_reedem()