diff --git a/tests/Integration/EventTest.php b/tests/Integration/EventTest.php index d2dc720..5137831 100644 --- a/tests/Integration/EventTest.php +++ b/tests/Integration/EventTest.php @@ -3,6 +3,7 @@ namespace Edofre\Fullcalendar\Test\Integration; use Carbon\Carbon; +use Edofre\Fullcalendar\Event; /** * Class EventTest @@ -13,27 +14,73 @@ class EventTest extends \Orchestra\Testbench\TestCase /** @test */ public function generate_event_with_id() { - $model = new \Edofre\Fullcalendar\Event( + $event = new Event( [ 'id' => 1, ] ); - $this->assertEquals('1', $model->id); - $this->assertNotEquals('2', $model->id); + $this->assertEquals('1', $event->id); + $this->assertNotEquals('2', $event->id); } /** @test */ public function generate_event_with_start_end_dates() { - $model = new \Edofre\Fullcalendar\Event( + $event = new Event( [ 'start' => Carbon::create(2016, 11, 16, 10), 'end' => Carbon::create(2016, 11, 16, 13), ] ); - $this->assertEquals("2016-11-16T10:00:00+00:00", $model->start); - $this->assertNotEquals("2016-11-16T10:00:00+00:00", $model->end); + $this->assertEquals("2016-11-16T10:00:00+00:00", $event->start); + $this->assertNotEquals("2016-11-16T10:00:00+00:00", $event->end); + } + + /** @test */ + public function generate_event_with_all_attributes() + { + $event = new Event( + [ + 'id' => '1', + 'title' => 'Test event', + 'allDay' => false, + 'start' => Carbon::create(2016, 11, 16, 10), + 'end' => Carbon::create(2016, 11, 16, 13), + 'url' => 'www.test.dev', + 'className' => 'test-event', + 'editable' => true, + 'startEditable' => true, + 'durationEditable' => true, + 'rendering' => Event::RENDERING_BACKGROUND, + 'overlap' => false, + 'constraint' => 'businessHours', + 'color' => '', + 'backgroundColor' => 'red', + 'borderColor' => 'black', + 'textColor' => 'black', + ] + ); + + $this->assertNotEquals('2', $event->id); + $this->assertEquals("Test event", $event->title); + $this->assertEquals(false, $event->allDay); + $this->assertEquals("2016-11-16T10:00:00+00:00", $event->start); + $this->assertNotEquals("2016-11-16T10:00:00+00:00", $event->end); + $this->assertEquals('www.test.dev', $event->url); + $this->assertNotEquals('event-test', $event->className); + $this->assertEquals(true, $event->editable); + $this->assertEquals(true, $event->startEditable); + $this->assertNotEquals(false, $event->durationEditable); + $this->assertNotEquals(Event::RENDERING_INVERSE_BACKGROUND, $event->rendering); + $this->assertNotEquals(true, $event->overlap); + $this->assertEquals('businessHours', $event->constraint); + $this->assertNotEquals('purple', $event->color); + $this->assertEquals('red', $event->backgroundColor); + $this->assertNotEquals('pink', $event->borderColor); + $this->assertEquals('black', $event->textColor); + + } } \ No newline at end of file