-
Notifications
You must be signed in to change notification settings - Fork 0
/
AbstractFactoryTest.php
41 lines (35 loc) · 1.06 KB
/
AbstractFactoryTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace Tests;
use Patterns\Creational\AbstractFactory\BmwVehicleFactory;
use Patterns\Creational\AbstractFactory\CarModel;
use Patterns\Creational\AbstractFactory\HondaVehicleFactory;
use Patterns\Creational\AbstractFactory\MotorcycleModel;
use Patterns\Creational\AbstractFactory\VehicleFactory;
class AbstractFactoryTest extends BaseTestCase
{
public function provideData(): array
{
return [
[new HondaVehicleFactory()],
[new BmwVehicleFactory()],
];
}
/**
* @dataProvider provideData
* @param VehicleFactory $factory
*/
public function testCanCreateCarModel(VehicleFactory $factory)
{
$model = $factory->createCarModel();
$this->assertInstanceOf(CarModel::class, $model);
}
/**
* @dataProvider provideData
* @param VehicleFactory $factory
*/
public function testCanCreateMotorcycleModel(VehicleFactory $factory)
{
$model = $factory->createMotorcycleModel();
$this->assertInstanceOf(MotorcycleModel::class, $model);
}
}