FactoryTest.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /*
  3. * This file is part of the php-phantomjs.
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. */
  8. namespace JonnyW\PhantomJs\Test\Message;
  9. use JonnyW\PhantomJs\Message\Factory;
  10. /**
  11. * PHP PhantomJs
  12. *
  13. * @author Jon Wenmoth <contact@jonnyw.me>
  14. */
  15. class FactoryTest extends \PHPUnit_Framework_TestCase
  16. {
  17. /**
  18. * Factory instance
  19. *
  20. * @var \JonnyW\PhantomJs\Message\Factory
  21. */
  22. protected $factory;
  23. /**
  24. * Setup tests
  25. *
  26. * @return void
  27. */
  28. protected function setUp()
  29. {
  30. parent::setUp();
  31. $this->factory = Factory::getInstance();
  32. }
  33. /**
  34. * Test create request instance
  35. *
  36. * @return void
  37. */
  38. public function testRequestInstance()
  39. {
  40. $request = $this->factory->createRequest();
  41. $this->assertInstanceOf('JonnyW\PhantomJs\Message\RequestInterface', $request);
  42. }
  43. /**
  44. * Test create response instance
  45. *
  46. * @return void
  47. */
  48. public function testResponseInstance()
  49. {
  50. $response = $this->factory->createResponse();
  51. $this->assertInstanceOf('JonnyW\PhantomJs\Message\ResponseInterface', $response);
  52. }
  53. }