AbstractConsumerTest.php
2 years ago
CurlConsumerTest.php
2 years ago
FileConsumerTest.php
2 years ago
SocketConsumerTest.php
2 years ago
index.php
2 years ago
AbstractConsumerTest.php
29 lines
| 1 | <?php |
| 2 | if (!defined('ABSPATH')) exit; |
| 3 | class ConsumerStrategies_AbstractConsumerTest extends PHPUnit_Framework_TestCase { |
| 4 | protected $_instance = null; |
| 5 | protected function setUp() |
| 6 | { |
| 7 | parent::setUp(); |
| 8 | $this->_instance = new AbstractConsumer(); |
| 9 | } |
| 10 | protected function tearDown() |
| 11 | { |
| 12 | parent::tearDown(); |
| 13 | $this->_instance = null; |
| 14 | } |
| 15 | public function test_encode() { |
| 16 | $encoded = base64_encode(json_encode(array("1" => "one"))); |
| 17 | $this->assertEquals($encoded, $this->_instance->encode(array("1" => "one"))); |
| 18 | } |
| 19 | } |
| 20 | class AbstractConsumer extends ConsumerStrategies_AbstractConsumer { |
| 21 | function persist($batch) |
| 22 | { |
| 23 | // TODO: Implement persist() method. |
| 24 | } |
| 25 | function encode($msg) { |
| 26 | return $this->_encode($msg); |
| 27 | } |
| 28 | } |
| 29 |