This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module GraphQL | |
module Relay | |
module Cursor | |
# The encoder/decoder for the cursor used in our smart GraphQL connections | |
class DefaultEngine | |
def encode(data) | |
Base64.strict_encode64(JSON.generate(data)) | |
end | |
def decode(cursor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Assert that 2 datetime strings are equal within a margin | |
* | |
* @param string $expected | |
* @param string $result | |
* @param integer $margin The margin in seconds | |
* @param string $message optional message | |
* @return boolean | |
*/ | |
public function assertDateEquals($expected, $result, $margin = 1, $message = '') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MockAMQPConnection extends AMQPConnection { | |
protected $foo = 'bar'; | |
public function getFoo() { | |
return $this->foo; | |
} | |
} | |
$mock = new MockAMQPConnection(); |