| @@ 17-37 (lines=21) @@ | ||
| 14 | } |
|
| 15 | } |
|
| 16 | ||
| 17 | class FakePostYear |
|
| 18 | { |
|
| 19 | public $kernel; |
|
| 20 | function __construct() |
|
| 21 | { |
|
| 22 | $this->kernel = new Stub_Kernel; |
|
| 23 | $this->kernel->setting->set('intranet', 'vatpercent', 25); |
|
| 24 | } |
|
| 25 | function get() |
|
| 26 | { |
|
| 27 | return 1; |
|
| 28 | } |
|
| 29 | function vatAccountIsSet() |
|
| 30 | { |
|
| 31 | return true; |
|
| 32 | } |
|
| 33 | function getSetting() |
|
| 34 | { |
|
| 35 | return 1; |
|
| 36 | } |
|
| 37 | } |
|
| 38 | ||
| 39 | class PostTest extends PHPUnit_Framework_TestCase |
|
| 40 | { |
|
| @@ 5-25 (lines=21) @@ | ||
| 2 | require_once 'Intraface/modules/accounting/Voucher.php'; |
|
| 3 | require_once 'Intraface/modules/accounting/VoucherFile.php'; |
|
| 4 | ||
| 5 | class FakeVoucherYear |
|
| 6 | { |
|
| 7 | public $kernel; |
|
| 8 | function __construct() |
|
| 9 | { |
|
| 10 | $this->kernel = new Stub_Kernel; |
|
| 11 | $this->kernel->setting->set('intranet', 'vatpercent', 25); |
|
| 12 | } |
|
| 13 | function get() |
|
| 14 | { |
|
| 15 | return 1; |
|
| 16 | } |
|
| 17 | function vatAccountIsSet() |
|
| 18 | { |
|
| 19 | return true; |
|
| 20 | } |
|
| 21 | function getSetting() |
|
| 22 | { |
|
| 23 | return 1; |
|
| 24 | } |
|
| 25 | } |
|
| 26 | ||
| 27 | class VoucherTest extends PHPUnit_Framework_TestCase |
|
| 28 | { |
|
| @@ 6-34 (lines=29) @@ | ||
| 3 | require_once 'Intraface/modules/accounting/YearEnd.php'; |
|
| 4 | require_once 'Intraface/Kernel.php'; |
|
| 5 | ||
| 6 | class FakeYearEndYear |
|
| 7 | { |
|
| 8 | public $kernel; |
|
| 9 | function __construct() |
|
| 10 | { |
|
| 11 | $this->kernel = new Stub_Kernel; |
|
| 12 | $this->kernel->setting->set('intranet', 'vatpercent', 25); |
|
| 13 | } |
|
| 14 | function get() |
|
| 15 | { |
|
| 16 | return 1; |
|
| 17 | } |
|
| 18 | ||
| 19 | function getSetting() |
|
| 20 | { |
|
| 21 | return 1; |
|
| 22 | } |
|
| 23 | ||
| 24 | function isYearOpen() |
|
| 25 | { |
|
| 26 | return true; |
|
| 27 | } |
|
| 28 | ||
| 29 | function isDateInYear() |
|
| 30 | { |
|
| 31 | return true; |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||
| 35 | class FakeYearEndAccount extends Account |
|
| 36 | { |
|
| 37 | function __construct($year) |
|