Also test PHP 7.2

This commit is contained in:
James Cole 2018-04-15 10:44:47 +02:00
parent ef62e31b61
commit ae273f8320
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
5 changed files with 21 additions and 4 deletions

View File

@ -1,6 +1,7 @@
language: php
php:
- 7.1
- 7.2
cache:
directories:

View File

@ -130,7 +130,7 @@ var suffixes$4 = {
90: '\'ıncı'
};
hooks.defineLocale('tr_TR', {
moment.defineLocale('tr_TR', {
months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),
monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),

View File

@ -57,10 +57,13 @@ class TwoFactorControllerTest extends TestCase
$truePref->data = true;
$secretPreference = new Preference;
$secretPreference->data = 'JZMES376Z6YXY4QZ';
$langPreference = new Preference;
$langPreference->data = 'en_US';
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($truePref)->twice();
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn($secretPreference)->once();
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn($secretPreference)->once();
Preferences::shouldReceive('get')->withArgs(['language', 'en_US'])->andReturn($langPreference);
$response = $this->get(route('two-factor.index'));
$response->assertStatus(200);
@ -75,9 +78,13 @@ class TwoFactorControllerTest extends TestCase
$falsePreference = new Preference;
$falsePreference->data = false;
$langPreference = new Preference;
$langPreference->data = 'en_US';
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($falsePreference)->twice();
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn(null)->once();
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn(null)->once();
Preferences::shouldReceive('get')->withArgs(['language', 'en_US'])->andReturn($langPreference);
$response = $this->get(route('two-factor.index'));
$response->assertStatus(302);
@ -96,9 +103,13 @@ class TwoFactorControllerTest extends TestCase
$truePref->data = true;
$secretPreference = new Preference;
$secretPreference->data = '';
$langPreference = new Preference;
$langPreference->data = 'en_US';
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($truePref)->twice();
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn($secretPreference)->once();
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn($secretPreference)->once();
Preferences::shouldReceive('get')->withArgs(['language', 'en_US'])->andReturn($langPreference);
$response = $this->get(route('two-factor.index'));
$response->assertStatus(500);
@ -115,9 +126,13 @@ class TwoFactorControllerTest extends TestCase
$truePreference->data = true;
$secretPreference = new Preference;
$secretPreference->data = 'JZMES376Z6YXY4QZ';
$langPreference = new Preference;
$langPreference->data = 'en_US';
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($truePreference);
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn($secretPreference);
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn($secretPreference);
Preferences::shouldReceive('get')->withArgs(['language', 'en_US'])->andReturn($langPreference);
$response = $this->get(route('two-factor.lost'));
$response->assertStatus(200);

View File

@ -97,13 +97,14 @@ class NewUserControllerTest extends TestCase
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$accountRepos->shouldReceive('store')->times(2);
$accountRepos->shouldReceive('store')->times(3);
$currencyRepos->shouldReceive('findNull')->andReturn(TransactionCurrency::find(1));
$data = [
'bank_name' => 'New bank',
'savings_balance' => '1000',
'bank_balance' => '100',
'language' => 'en_US',
'amount_currency_id_bank_balance' => 1,
];
$this->be($this->emptyUser());
@ -122,7 +123,7 @@ class NewUserControllerTest extends TestCase
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$accountRepos->shouldReceive('store')->twice();
$accountRepos->shouldReceive('store')->times(3);
$currencyRepos->shouldReceive('findNull')->andReturn(TransactionCurrency::find(1));
$data = [

View File

@ -30,7 +30,7 @@ use FireflyIII\Repositories\User\UserRepositoryInterface;
use Illuminate\Support\Collection;
use Log;
use Tests\TestCase;
use Preferences;
/**
* Class PreferencesControllerTest
*