Commits

Thomas Weinert committed db33077

Tested: Carica\Io\Deferred\Promise::state()

Comments (0)

Files changed (1)

tests/Io/Deferred/PromiseTest.php

       $promise = new Promise($defer);
       $this->assertSame($promise, $promise->progress($function));
     }
+
+    /**
+     * @covers Carica\Io\Deferred\Promise::state
+     */
+    public function testState() {
+      $defer = $this->getMock('Carica\Io\Deferred');
+      $defer
+        ->expects($this->once())
+        ->method('state')
+        ->will($this->returnValue(Io\Deferred::STATE_PENDING));
+
+      $promise = new Promise($defer);
+      $this->assertEquals(Io\Deferred::STATE_PENDING, $promise->state());
+    }
   }
 }