예제 #1
0
 /**
  * Register any other events for your application.
  *
  * @param  \Illuminate\Contracts\Events\Dispatcher  $events
  * @return void
  */
 public function boot(DispatcherContract $events)
 {
     parent::boot($events);
     Piece::observe(new AddSlugAttribute());
     Preset::observe(new AddSlugAttribute());
 }
예제 #2
0
 /** @test **/
 public function it_creates_positions_with_the_total_number_of_pieces_available_when_it_is_created()
 {
     $user = $this->createActiveUser();
     $preset = factory(Preset::class)->create(['user_id' => $user->id]);
     $this->assertEquals(Piece::count(), Position::count());
 }