firefly-iii/tests/functional/ReminderControllerCest.php

88 lines
2.1 KiB
PHP
Raw Normal View History

2015-02-07 01:42:20 -06:00
<?php
2015-02-07 05:15:53 -06:00
use FireflyIII\Models\Reminder;
2015-02-11 00:35:10 -06:00
2015-02-07 01:42:20 -06:00
/**
* Class ReminderControllerCest
*
* @SuppressWarnings("CamelCase")
* @SuppressWarnings("short")
*/
class ReminderControllerCest
{
/**
* @param FunctionalTester $I
*/
public function _after(FunctionalTester $I)
{
}
/**
* @param FunctionalTester $I
*/
public function _before(FunctionalTester $I)
{
$I->amLoggedAs(['email' => 'thegrumpydictator@gmail.com', 'password' => 'james']);
}
/**
* @param FunctionalTester $I
*/
public function act(FunctionalTester $I)
{
2015-02-11 00:35:10 -06:00
$reminder = Reminder::leftJoin('piggy_banks', 'piggy_banks.id', '=', 'reminders.remindersable_id')->where('piggy_banks.reminder', '!=', '')->first(
2015-02-07 01:42:20 -06:00
['reminders.*']
);
$I->wantTo('act on a reminder');
$I->amOnPage('/reminders/' . $reminder->id . '/act');
$I->see('Money for Nieuwe spullen');
}
/**
* @param FunctionalTester $I
*/
public function actOnInvalid(FunctionalTester $I)
{
$I->wantTo('act on an invalid reminder');
$I->amOnPage('/reminders/2/act');
$I->see('This reminder has an invalid class connected to it.');
}
/**
* @param FunctionalTester $I
*/
public function dismiss(FunctionalTester $I)
{
$I->wantTo('dismiss a reminder');
$I->amOnPage('/reminders/1/dismiss');
$I->see('Reminder dismissed');
}
/**
* @param FunctionalTester $I
*/
public function notNow(FunctionalTester $I)
{
$I->wantTo('ignore a reminder');
$I->amOnPage('/reminders/1/notNow');
$I->see('Reminder dismissed');
}
/**
* @param FunctionalTester $I
*/
public function show(FunctionalTester $I)
{
2015-02-11 00:35:10 -06:00
$reminder = Reminder::leftJoin('piggy_banks', 'piggy_banks.id', '=', 'reminders.remindersable_id')->where('piggy_banks.reminder', '!=', '')->first(
2015-02-07 01:42:20 -06:00
['reminders.*']
);
$I->wantTo('see a reminder');
2015-02-11 00:35:10 -06:00
$I->amOnPage('/reminders/' . $reminder->id);
2015-02-07 01:42:20 -06:00
$I->see('A reminder about');
$I->see('your piggy bank labelled "Nieuwe spullen"');
}
}