43 lines
1,021 B
PHP
43 lines
1,021 B
PHP
<?php
|
|
|
|
namespace App\Tests\Speakers;
|
|
|
|
use App\Speakers\TwigExtension\SpeakersExtension;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class SpeakerTest extends TestCase
|
|
{
|
|
/**
|
|
* @var \App\Speakers\TwigExtension\SpeakersExtension
|
|
*/
|
|
private $extension;
|
|
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
$this->extension = new SpeakersExtension();
|
|
}
|
|
|
|
/** @test */
|
|
public function get_sessions_for_a_speaker()
|
|
{
|
|
$speaker = ['title' => 'Oliver Davies'];
|
|
|
|
$sessions = [
|
|
['title' => 'Introduction to Views', 'speakers' => ['Tom Metcalfe']],
|
|
['title' => 'Test Driven Drupal', 'speakers' => ['Oliver Davies']],
|
|
];
|
|
|
|
$sessions = $this->extension->getSpeakerSessions($speaker, $sessions);
|
|
|
|
$this->assertCount(1, $sessions);
|
|
$this->assertSame('Test Driven Drupal', $sessions[0]['title']);
|
|
}
|
|
|
|
/** @test */
|
|
public function get_speakers_for_a_session()
|
|
{
|
|
$this->markTestIncomplete();
|
|
}
|
|
}
|