Expand test code.

This commit is contained in:
James Cole
2021-03-19 06:12:28 +01:00
parent b4d44fdd2b
commit 03d3ede036
37 changed files with 1343 additions and 1187 deletions

View File

@@ -37,33 +37,6 @@ class StoreControllerTest extends TestCase
{
use RandomValues, TestHelpers, CollectsValues;
/**
*
*/
public function setUp(): void
{
parent::setUp();
Passport::actingAs($this->user());
Log::info(sprintf('Now in %s.', get_class($this)));
}
/**
* @param array $submission
*
* emptyDataProvider / storeDataProvider
* @dataProvider storeDataProvider
*/
public function testStore(array $submission): void
{
if ([] === $submission) {
$this->markTestSkipped('Empty data provider');
}
// run account store with a minimal data set:
$route = 'api.v1.attachments.store';
$this->storeAndCompare($route, $submission);
}
/**
* @return array
*/
@@ -73,6 +46,15 @@ class StoreControllerTest extends TestCase
}
/**
*
*/
public function setUp(): void
{
parent::setUp();
Passport::actingAs($this->user());
Log::info(sprintf('Now in %s.', get_class($this)));
}
/**
* @return array
@@ -86,7 +68,6 @@ class StoreControllerTest extends TestCase
return $this->genericDataProvider($minimalSets, $optionalSets, $regenConfig);
}
/**
* @return array
*/
@@ -135,4 +116,21 @@ class StoreControllerTest extends TestCase
],
];
}
/**
* @param array $submission
*
* emptyDataProvider / storeDataProvider
*
* @dataProvider storeDataProvider
*/
public function testStore(array $submission): void
{
if ([] === $submission) {
$this->markTestSkipped('Empty data provider');
}
// run account store with a minimal data set:
$route = 'api.v1.attachments.store';
$this->storeAndCompare($route, $submission);
}
}

View File

@@ -110,7 +110,7 @@ class UpdateControllerTest extends TestCase
'id' => 1,
'fields' => [
'attachable_type' => ['test_value' => 'TransactionJournal'],
'attachable_id' => ['test_value' => (string)2],
'attachable_id' => ['test_value' => (string)2],
],
'extra_ignore' => [],
],