JmesRuntimeFactoryTest.php in Feeds extensible parsers 8
File
tests/src/Unit/JmesRuntimeFactoryTest.php
View source
<?php
namespace Drupal\Tests\feeds_ex\Unit;
use Drupal\feeds_ex\JmesRuntimeFactory;
use org\bovigo\vfs\vfsStream;
class JmesRuntimeFactoryTest extends UnitTestBase {
protected $factory;
public function setUp() {
$this->factory = new JmesRuntimeFactory();
}
public function testCreateRuntime() {
$runtime = $this->factory
->createRuntime();
$this
->assertTrue(method_exists($runtime, '__invoke'));
}
public function testCreateAstRuntime() {
$runtime = $this->factory
->createAstRuntime();
$this
->assertInstanceOf('JmesPath\\AstRuntime', $runtime);
}
public function testCreateCompilerRuntime() {
$stream = vfsStream::setup('feeds');
$runtime = $this->factory
->createCompilerRuntime($stream
->url());
$this
->assertInstanceOf('JmesPath\\CompilerRuntime', $runtime);
}
}