mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-27 17:45:17 +00:00
28 lines
703 B
PHP
28 lines
703 B
PHP
<?php
|
|
|
|
use App\Concert;
|
|
use Carbon\Carbon;
|
|
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
|
|
class ConcertTest extends TestCase
|
|
{
|
|
use DatabaseMigrations;
|
|
|
|
/** @test */
|
|
function can_get_formatted_date()
|
|
{
|
|
// Create a concert with a known date
|
|
$concert = factory(Concert::class)->create([
|
|
'date' => Carbon::parse('2016-12-01 8:00pm'),
|
|
]);
|
|
|
|
// Retrieve the formatted date
|
|
$date = $concert->formatted_date;
|
|
|
|
// Verify the date is formatted as expected
|
|
$this->assertEquals('December 1, 2016', $date);
|
|
}
|
|
}
|