Skip to content

Commit

Permalink
Include alias and serviceprovider in setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Edofre committed Mar 17, 2017
1 parent 7c69c58 commit 5b3f117
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
44 changes: 44 additions & 0 deletions tests/Integration/FullcalendarTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace Edofre\Fullcalendar\Test\Integration;

/**
* Class FullcalendarTest
* @package Edofre\Fullcalendar\Test\Integration
*/
class FullcalendarTest extends TestCase
{

/** @test */
public function generate_event_with_id()
{
// Generate a new fullcalendar instance
$calendar = new \Edofre\Fullcalendar\Fullcalendar();

// Set options
$calendar->setOptions([
'locale' => 'nl',
'weekNumbers' => true,
'selectable' => true,
'defaultView' => 'agendaWeek',
]);

// This looks terrible, I'm sorry...
$this->assertEquals("<div id='fullcalendar'></div><!-- fullcalendar css -->
<link href=\"/css/fullcalendar.print.css\" rel=\"stylesheet\" media=\"print\">
<link href=\"/css/fullcalendar.css\" rel=\"stylesheet\">
<!-- moment js -->
<script src=\"/js/moment.js\"></script>
<!-- fullcalendar js -->
<script src=\"/js/fullcalendar.js\"></script>
<script src=\"/js/locale-all.js\"></script>
<script type=\"text/javascript\">
jQuery(document).ready(function () {
jQuery('#fullcalendar').fullCalendar({\"header\":{\"left\":\"prev,next today\",\"center\":\"title\",\"right\":\"month,agendaWeek,agendaDay\"},\"firstDay\":1,\"locale\":\"nl\",\"weekNumbers\":true,\"selectable\":true,\"defaultView\":\"agendaWeek\",\"events\":[]});
});
</script>
", $calendar->generate());
}
}
21 changes: 21 additions & 0 deletions tests/Integration/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,27 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
public function setUp()
{
parent::setUp();
}

/**
* @param \Illuminate\Foundation\Application $app
* @return array
*/
protected function getPackageProviders($app)
{
return [
\Edofre\Fullcalendar\FullcalendarServiceProvider::class,
];
}

/**
* @param \Illuminate\Foundation\Application $app
* @return array
*/
protected function getPackageAliases($app)
{
return [
'Fullcalendar' => \Edofre\Fullcalendar\Facades\Fullcalendar::class,
];
}
}

0 comments on commit 5b3f117

Please sign in to comment.