mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 02:36:28 +00:00 
			
		
		
		
	All of this should contain one working test.
This commit is contained in:
		| @@ -1,33 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| use Illuminate\Database\Migrations\Migration; | ||||
|  | ||||
| class ExpandRemindersTable extends Migration | ||||
| { | ||||
|  | ||||
|     /** | ||||
|      * Reverse the migrations. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function down() | ||||
|     { | ||||
|         // | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Run the migrations. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function up() | ||||
|     { | ||||
|         Schema::table( | ||||
|             'reminders', function (Blueprint $table) { | ||||
|                 $table->string('title'); | ||||
|                 $table->text('data'); | ||||
|             } | ||||
|         ); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -1,6 +1,7 @@ | ||||
| <?php | ||||
|  | ||||
| use Illuminate\Database\Migrations\Migration; | ||||
| use Illuminate\Database\Schema\Blueprint; | ||||
|  | ||||
| class ExtendPiggybankEvents extends Migration | ||||
| { | ||||
|   | ||||
| @@ -26,10 +26,8 @@ class EventTableAdditions1 extends Migration | ||||
|         // remove some fields: | ||||
|         Schema::table( | ||||
|             'reminders', function (Blueprint $table) { | ||||
|                 $table->dropColumn('title'); | ||||
|                 $table->dropColumn('data'); | ||||
|                 $table->integer('remembersable_id')->unsigned()->nullable(); | ||||
|                 $table->string('remembersable_type'); | ||||
|                 $table->string('remembersable_type')->nullable(); | ||||
|             } | ||||
|         ); | ||||
|     } | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
|  | ||||
| App::before( | ||||
|     function ($request) { | ||||
|         $reminders = []; | ||||
|  | ||||
|         if (Auth::check()) { | ||||
|             /** @var \FireflyIII\Shared\Toolkit\Filter $toolkit */ | ||||
| @@ -14,9 +15,10 @@ App::before( | ||||
|             $reminderKit = App::make('FireflyIII\Shared\Toolkit\Reminders'); | ||||
|  | ||||
|             $reminderKit->updateReminders(); | ||||
|             View::share('reminders',$reminderKit->getReminders()); | ||||
|             $reminders = $reminderKit->getReminders(); | ||||
|  | ||||
|         } | ||||
|         View::share('reminders', $reminders); | ||||
|  | ||||
|     } | ||||
| ); | ||||
|   | ||||
| @@ -42,6 +42,7 @@ class User extends Ardent implements UserInterface, RemindableInterface | ||||
|     public static $rules | ||||
|         = ['email' => 'required|email|unique:users,email', 'migrated' => 'required|boolean', 'password' => 'required|between:60,60', | ||||
|            'reset' => 'between:32,32',]; | ||||
|     protected $fillable = ['email']; | ||||
|     /** | ||||
|      * The attributes excluded from the model's JSON form. | ||||
|      * | ||||
|   | ||||
| @@ -1,4 +1,5 @@ | ||||
| <?php | ||||
|  | ||||
| /** | ||||
|  * Generated by PHPUnit_SkeletonGenerator on 2014-11-18 at 09:03:51. | ||||
|  */ | ||||
| @@ -15,14 +16,7 @@ class HomeControllerTest extends TestCase | ||||
|      */ | ||||
|     public function setUp() | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Tears down the fixture, for example, closes a network connection. | ||||
|      * This method is called after a test is executed. | ||||
|      */ | ||||
|     protected function tearDown() | ||||
|     { | ||||
|         parent::setUp(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -32,9 +26,7 @@ class HomeControllerTest extends TestCase | ||||
|     public function testFlush() | ||||
|     { | ||||
|         // Remove the following lines when you implement this test. | ||||
|         $this->markTestIncomplete( | ||||
|             'This test has not been implemented yet.' | ||||
|         ); | ||||
|         $this->markTestIncomplete('This test has not been implemented yet.'); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -43,10 +35,12 @@ class HomeControllerTest extends TestCase | ||||
|      */ | ||||
|     public function testIndex() | ||||
|     { | ||||
|         // Remove the following lines when you implement this test. | ||||
|         $this->markTestIncomplete( | ||||
|             'This test has not been implemented yet.' | ||||
|         ); | ||||
|         $this->be(new User(['email' => 'test@example.com'])); | ||||
|  | ||||
|         $response = $this->call('GET', '/'); | ||||
|         $this->assertResponseOk(); | ||||
|  | ||||
|         $this->assertTrue(true); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -84,4 +78,12 @@ class HomeControllerTest extends TestCase | ||||
|             'This test has not been implemented yet.' | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Tears down the fixture, for example, closes a network connection. | ||||
|      * This method is called after a test is executed. | ||||
|      */ | ||||
|     protected function tearDown() | ||||
|     { | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -15,4 +15,11 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase { | ||||
|         $testEnvironment = 'testing'; | ||||
|         return require __DIR__.'/../../bootstrap/start.php'; | ||||
|     } | ||||
|  | ||||
|     public function setUp() { | ||||
|         parent::setUp(); | ||||
|         Artisan::call('migrate'); | ||||
|         $this->seed(); | ||||
|         //$this-> | ||||
|     } | ||||
| } | ||||
| @@ -14,7 +14,7 @@ | ||||
|     <ul class="nav navbar-top-links navbar-right"> | ||||
|  | ||||
|         <!-- reminders --> | ||||
|         @if(count($reminders) > 0) | ||||
|         @if(isset($reminders) && count($reminders) > 0) | ||||
|         <li class="dropdown"> | ||||
|             <a class="dropdown-toggle" data-toggle="dropdown" href="#"> | ||||
|                 <i class="fa fa-bell fa-fw"></i>  <i class="fa fa-caret-down"></i> | ||||
|   | ||||
| @@ -24,7 +24,6 @@ | ||||
|             <directory suffix=".php">./app/helpers</directory> | ||||
|             <exclude> | ||||
|                 <file>./app/controllers/BaseController.php</file> | ||||
|                 <file>./app/controllers/MigrationController.php</file> | ||||
|             </exclude> | ||||
|         </whitelist> | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user