1
0
mirror of https://github.com/danog/amp.git synced 2024-12-03 18:07:57 +01:00
amp/test/LoopStateTest.php

43 lines
831 B
PHP
Raw Normal View History

<?php
2017-01-02 21:48:48 +01:00
namespace AsyncInterop\Loop;
class LoopStateTest extends \PHPUnit_Framework_TestCase
2016-05-16 11:33:58 +02:00
{
private $loop;
2016-05-16 11:33:58 +02:00
protected function setUp()
{
$this->loop = $this->getMockForAbstractClass(Driver::class);
}
/** @test */
2016-05-16 11:33:58 +02:00
public function defaultsToNull()
{
$this->assertNull($this->loop->getState("foobar"));
}
/**
* @test
* @dataProvider provideValues
*/
public function getsPreviouslySetValue($value)
2016-05-16 11:33:58 +02:00
{
$this->loop->setState("foobar", $value);
$this->assertSame($value, $this->loop->getState("foobar"));
}
2016-05-16 11:33:58 +02:00
public function provideValues()
{
return [
["string"],
[42],
[1.001],
[true],
[false],
[null],
[new \StdClass],
];
}
}