Smaller fixes like typos and code presentation inconsistencies.

Add some helper variables to tests, to cut down the amount of code a bit and make it more readable.
parent 68660025
......@@ -27,13 +27,6 @@ class ChatTest extends TestCase
*/
private $chat;
/**
* setUp
*/
protected function setUp()
{
}
public function testChatType()
{
$this->chat = TestHelpers::getFakeChatObject();
......
......@@ -26,13 +26,6 @@ class MessageTest extends TestCase
*/
private $message;
/**
* setUp
*/
protected function setUp()
{
}
public function testTextAndCommandRecognise() {
// /command
$this->message = TestHelpers::getFakeMessageObject(['text' => '/help']);
......
......@@ -39,7 +39,7 @@ class ReplyToMessageTest extends TestCase
"message":{"message_id":4479,"from":{"id":123,"first_name":"John","username":"MJohn"},"chat":{"id":-123,"title":"MyChat","type":"group"},"date":1449092987,"reply_to_message":{"message_id":11,"from":{"id":121,"first_name":"Myname","username":"mybot"},"chat":{"id":-123,"title":"MyChat","type":"group"},"date":1449092984,"text":"type some text"},"text":"some text"}}
';
$struct = json_decode($json, true);
$update = new Update($struct,'mybot');
$update = new Update($struct, 'mybot');
$this->message = $update->getMessage();
$this->reply_to_message = $this->message->getReplyToMessage();
......
This diff is collapsed.
......@@ -35,8 +35,7 @@ class UpdateTest extends TestCase
$struct = json_decode($json, true);
$update = new Update($struct, 'mybot');
$array_string_after = json_decode($update->toJSON(), true);
$array_string_after = json_decode($update->toJson(), true);
$this->assertEquals($struct, $array_string_after);
}
}
......@@ -42,7 +42,7 @@ class TelegramTest extends TestCase
{
$this->telegram = new Telegram('apikey', 'testbot');
// Create a few custom commands paths.
// Create a few dummy custom commands paths.
foreach ($this->custom_commands_paths as $custom_path) {
mkdir($custom_path);
}
......@@ -87,7 +87,7 @@ class TelegramTest extends TestCase
public function testEnableAdmins()
{
$tg = &$this->telegram;
$tg = $this->telegram;
$this->assertEmpty($tg->getAdminList());
......@@ -106,7 +106,7 @@ class TelegramTest extends TestCase
public function testAddCustomCommandsPaths()
{
$tg = &$this->telegram;
$tg = $this->telegram;
$this->assertAttributeCount(1, 'commands_paths', $tg);
......
......@@ -14,7 +14,7 @@ class TestCase extends \PHPUnit_Framework_TestCase
{
protected function skip64BitTest()
{
if (PHP_INT_SIZE == 4) {
if (PHP_INT_SIZE === 4) {
$this->markTestSkipped(
'Skipping test that can run only on a 64-bit build of PHP.'
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment