public function testExecute()
 {
     // Assert
     $callback = $this->getMockForAbstractClass(NodeInterface::class);
     $callback->expects($this->once())->method('execute');
     // Arrange
     $variable = new ResourceVariable();
     $variable->setValue(tmpfile());
     $action = new StreamCloseAction();
     $action->bind(StreamCloseAction::SOCKET_STREAM, $variable);
     $action->bind(StreamCloseAction::SOCKET_OUTPUT, $callback);
     // Act
     $action->execute();
 }
 public function testExecute()
 {
     // Assert
     $callback = $this->getMock(NodeInterface::class);
     $callback->expects($this->once())->method('execute');
     // Arrange
     $variableResource = new ResourceVariable();
     $variableResource->setValue(tmpfile());
     $variableData = new StringVariable();
     $variableData->setValue('test');
     $action = new StreamWriteAction();
     $action->bind(StreamWriteAction::SOCKET_STREAM, $variableResource);
     $action->bind(StreamWriteAction::SOCKET_DATA, $variableData);
     $action->bind(StreamWriteAction::SOCKET_OUTPUT, $callback);
     // Act
     $action->execute();
 }
Ejemplo n.º 3
0
 public function testExecute()
 {
     $variable = new ResourceVariable();
     $variable->execute();
 }