2016-03-25 01:18:05 -07:00
|
|
|
<?php
|
|
|
|
use App\Models\Category;
|
|
|
|
use Illuminate\Support\Facades\Hash;
|
|
|
|
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
|
|
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
|
|
|
|
|
|
class CategoryTest extends \Codeception\TestCase\Test
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var \UnitTester
|
|
|
|
*/
|
|
|
|
protected $tester;
|
|
|
|
use DatabaseMigrations;
|
|
|
|
|
|
|
|
public function testAssetCategoryAdd()
|
|
|
|
{
|
2017-01-18 16:50:33 -08:00
|
|
|
$category = factory(Category::class, 'category')->make(['category_type' => 'asset']);
|
|
|
|
$values = [
|
|
|
|
'name' => $category->name,
|
|
|
|
'category_type' => $category->category_type,
|
|
|
|
'require_acceptance' => true,
|
|
|
|
'use_default_eula' => false
|
|
|
|
];
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2017-01-18 16:50:33 -08:00
|
|
|
Category::create($values);
|
|
|
|
$this->tester->seeRecord('categories', $values);
|
2016-03-25 01:18:05 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testAccessoryCategoryAdd()
|
|
|
|
{
|
2017-01-18 16:50:33 -08:00
|
|
|
$category = factory(Category::class, 'category')->make(['category_type' => 'accessory']);
|
|
|
|
$values = [
|
|
|
|
'name' => $category->name,
|
|
|
|
'category_type' => $category->category_type,
|
|
|
|
'require_acceptance' => true,
|
|
|
|
'use_default_eula' => false
|
|
|
|
];
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2017-01-18 16:50:33 -08:00
|
|
|
Category::create($values);
|
|
|
|
$this->tester->seeRecord('categories', $values);
|
2016-03-25 01:18:05 -07:00
|
|
|
}
|
|
|
|
}
|