SimpleFbConnectPersistentDataHandlerTest.php in Simple FB Connect 8.3
File
tests/src/Unit/SimpleFbConnectPersistentDataHandlerTest.php
View source
<?php
namespace Drupal\Tests\simple_fb_connect\Unit;
use Drupal\Tests\UnitTestCase;
use Drupal\simple_fb_connect\SimpleFbConnectPersistentDataHandler;
class SimpleFbConnectPersistentDataHandlerTest extends UnitTestCase {
protected $session;
protected $persistentDataHandler;
protected function setUp() {
parent::setUp();
$this->session = $this
->getMock('Symfony\\Component\\HttpFoundation\\Session\\SessionInterface');
$this->persistentDataHandler = new SimpleFbConnectPersistentDataHandler($this->session);
}
public function testGet() {
$this->session
->expects($this
->once())
->method('get')
->with('simple_fb_connect_example_key')
->willReturn('hello world');
$this
->assertEquals('hello world', $this->persistentDataHandler
->get('example_key'));
}
}