Add cost_block_hour tests; extra logging

This commit is contained in:
Nabeel Shahzad
2018-03-29 14:55:25 -05:00
parent 2090f05236
commit 08d3578d38
5 changed files with 26 additions and 14 deletions

View File

@@ -45,6 +45,9 @@ class FinanceTest extends TestCase
* Setup tests
*/
$subfleet = $this->createSubfleetWithAircraft(2);
$subfleet['subfleet']->cost_block_hour = 10;
$subfleet['subfleet']->save();
$rank = $this->createRank(10, [$subfleet['subfleet']->id]);
$rank->acars_base_pay_rate = 10;
$rank->save();
@@ -642,15 +645,15 @@ class FinanceTest extends TestCase
$transactions = $journalRepo->getAllForObject($pirep);
$this->assertCount(8, $transactions['transactions']);
$this->assertCount(9, $transactions['transactions']);
$this->assertEquals(3020, $transactions['credits']->getValue());
$this->assertEquals(1840, $transactions['debits']->getValue());
$this->assertEquals(1860, $transactions['debits']->getValue());
# Check that all the different transaction types are there
# test by the different groups that exist
$transaction_tags = [
'expense' => 1,
'subfleet' => 1,
'subfleet' => 2,
'fare' => 3,
'ground_handling' => 1,
'pilot_pay' => 2, # debit on the airline, credit to the pilot