mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Standardize test method syntax
This commit is contained in:
parent
505ca48da2
commit
787f619a6b
|
@ -12,10 +12,7 @@ class AssetMaintenanceTest extends BaseTest
|
|||
*/
|
||||
protected $tester;
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_zeros_out_warranty_if_blank()
|
||||
public function testZerosOutWarrantyIfBlank()
|
||||
{
|
||||
$c = new AssetMaintenance;
|
||||
$c->is_warranty = '';
|
||||
|
@ -24,10 +21,7 @@ class AssetMaintenanceTest extends BaseTest
|
|||
$this->assertTrue($c->is_warranty == 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_sets_costs_appropriately()
|
||||
public function testSetsCostsAppropriately()
|
||||
{
|
||||
$c = new AssetMaintenance();
|
||||
$c->cost = '0.00';
|
||||
|
@ -38,10 +32,7 @@ class AssetMaintenanceTest extends BaseTest
|
|||
$this->assertTrue($c->cost === 9.5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_nulls_out_notes_if_blank()
|
||||
public function testNullsOutNotesIfBlank()
|
||||
{
|
||||
$c = new AssetMaintenance;
|
||||
$c->notes = '';
|
||||
|
@ -50,10 +41,7 @@ class AssetMaintenanceTest extends BaseTest
|
|||
$this->assertTrue($c->notes === 'This is a long note');
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_nulls_out_completion_date_if_blank_or_invalid()
|
||||
public function testNullsOutCompletionDateIfBlankOrInvalid()
|
||||
{
|
||||
$c = new AssetMaintenance;
|
||||
$c->completion_date = '';
|
||||
|
|
|
@ -41,10 +41,6 @@ class AssetTest extends BaseTest
|
|||
// $this->assertEquals($expected, $next);
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function testWarrantyExpiresAttribute()
|
||||
{
|
||||
|
||||
|
@ -66,5 +62,4 @@ class AssetTest extends BaseTest
|
|||
$this->assertEquals(Carbon::createFromDate(2019, 1, 1)->format('Y-m-d'), $asset->warranty_expires->format('Y-m-d'));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,12 +11,7 @@ class SnipeModelTest extends BaseTest
|
|||
*/
|
||||
protected $tester;
|
||||
|
||||
// tests
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_sets_purchase_dates_appropriately()
|
||||
public function testSetsPurchaseDatesAppropriately()
|
||||
{
|
||||
$c = new SnipeModel;
|
||||
$c->purchase_date = '';
|
||||
|
@ -25,10 +20,7 @@ class SnipeModelTest extends BaseTest
|
|||
$this->assertTrue($c->purchase_date === '2016-03-25 12:35:50');
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_sets_purchase_costs_appropriately()
|
||||
public function testSetsPurchaseCostsAppropriately()
|
||||
{
|
||||
$c = new SnipeModel;
|
||||
$c->purchase_cost = '0.00';
|
||||
|
@ -39,10 +31,7 @@ class SnipeModelTest extends BaseTest
|
|||
$this->assertTrue($c->purchase_cost === 9.5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_nulls_blank_location_ids_but_not_others()
|
||||
public function testNullsBlankLocationIdsButNotOthers()
|
||||
{
|
||||
$c = new SnipeModel;
|
||||
$c->location_id = '';
|
||||
|
@ -51,10 +40,7 @@ class SnipeModelTest extends BaseTest
|
|||
$this->assertTrue($c->location_id == 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_nulls_blank_categories_but_not_others()
|
||||
public function testNullsBlankCategoriesButNotOthers()
|
||||
{
|
||||
$c = new SnipeModel;
|
||||
$c->category_id = '';
|
||||
|
@ -63,10 +49,7 @@ class SnipeModelTest extends BaseTest
|
|||
$this->assertTrue($c->category_id == 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_nulls_blank_suppliers_but_not_others()
|
||||
public function testNullsBlankSuppliersButNotOthers()
|
||||
{
|
||||
$c = new SnipeModel;
|
||||
$c->supplier_id = '';
|
||||
|
@ -75,10 +58,7 @@ class SnipeModelTest extends BaseTest
|
|||
$this->assertTrue($c->supplier_id == 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_nulls_blank_depreciations_but_not_others()
|
||||
public function testNullsBlankDepreciationsButNotOthers()
|
||||
{
|
||||
$c = new SnipeModel;
|
||||
$c->depreciation_id = '';
|
||||
|
@ -87,10 +67,7 @@ class SnipeModelTest extends BaseTest
|
|||
$this->assertTrue($c->depreciation_id == 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_nulls_blank_manufacturers_but_not_others()
|
||||
public function testNullsBlankManufacturersButNotOthers()
|
||||
{
|
||||
$c = new SnipeModel;
|
||||
$c->manufacturer_id = '';
|
||||
|
|
Loading…
Reference in a new issue