Skip to content

Commit

Permalink
Merge pull request #154 from lucasmichot/feature/remove-useless-code
Browse files Browse the repository at this point in the history
Remove useless tests code.
  • Loading branch information
Alexandru Bucur committed Mar 9, 2021
2 parents 1831164 + cb2a6c6 commit b0ea00b
Show file tree
Hide file tree
Showing 17 changed files with 8 additions and 108 deletions.
6 changes: 0 additions & 6 deletions tests/Integration/Balance/BalanceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

class BalanceTest extends BaseTest
{
protected function setUp()
{
parent::setUp();
$this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient);
}

public function testReadBalance()
{
$this->expectException(\MessageBird\Exceptions\ServerException::class);
Expand Down
2 changes: 2 additions & 0 deletions tests/Integration/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class BaseTest extends TestCase

protected function setUp()
{
parent::setUp();

$this->mockClient = $this->getMockBuilder("\MessageBird\Common\HttpClient")->setConstructorArgs(["fake.messagebird.dev"])->getMock();
$this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient);
}
Expand Down
6 changes: 0 additions & 6 deletions tests/Integration/Chat/ChatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

class ChatTest extends BaseTest
{
protected function setUp()
{
parent::setUp();
$this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient);
}

public function testCreateChatMessage()
{
$chatMessage = new \MessageBird\Objects\Chat\Message();
Expand Down
6 changes: 0 additions & 6 deletions tests/Integration/Contacts/ContactTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

class ContactTest extends BaseTest
{
protected function setUp()
{
parent::setUp();
$this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient);
}

public function testCreateContact()
{
$contact = new \MessageBird\Objects\Contact();
Expand Down
7 changes: 0 additions & 7 deletions tests/Integration/Conversation/ConversationMessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ class ConversationMessageTest extends BaseTest
"type": "video"
}';

protected function setUp()
{
parent::setUp();

$this->client = new Client('YOUR_ACCESS_KEY', $this->mockClient);
}

public function testCreateImage()
{
$this->mockClient
Expand Down
19 changes: 6 additions & 13 deletions tests/Integration/Conversation/ConversationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,6 @@ class ConversationTest extends BaseTest
"lastUsedChannelId": "channel-id"
}';

protected function setUp()
{
parent::setUp();

$this->client = new Client('YOUR_ACCESS_KEY', $this->mockClient);
}

public function testStart()
{
$this->mockClient
Expand All @@ -122,7 +115,7 @@ public function testStart()
$message->to = '31612345678';
$message->type = 'location';
$message->content = $content;

$this->client->conversations->start($message);
}

Expand All @@ -135,10 +128,10 @@ public function testCreate()
->expects($this->once())->method('performHttpRequest')
->with('POST', 'conversations', null, self::CREATE_REQUEST)
->willReturn([200, '', '{}']);

$this->client->conversations->create('some-contact-id');
}

public function testList()
{
$this->mockClient
Expand Down Expand Up @@ -178,12 +171,12 @@ public function testUpdate()
->expects($this->exactly(2))->method('performHttpRequest')
->withConsecutive(
['PATCH', 'conversations/conversation-id', null, '{"status":"archived"}'],
['PATCH', 'conversations/conversation-id', null, '{"status":"active"}']
['PATCH', 'conversations/conversation-id', null, '{"status":"active"}']
)
->willReturn([200, '', '{}']);

$conversation = new Conversation();

$conversation->status = Conversation::STATUS_ARCHIVED;
$this->client->conversations->update($conversation, 'conversation-id');

Expand Down Expand Up @@ -236,4 +229,4 @@ private function getConversation()

return $conversation;
}
}
}
7 changes: 0 additions & 7 deletions tests/Integration/Conversation/ConversationWebhookTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ class ConversationWebhookTest extends BaseTest
"updatedDatetime": "2018-07-20T12:13:51+00:00"
}';

protected function setUp()
{
parent::setUp();

$this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient);
}

public function testDelete()
{
$this->mockClient
Expand Down
6 changes: 0 additions & 6 deletions tests/Integration/Groups/GroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

class GroupTest extends BaseTest
{
protected function setUp()
{
parent::setUp();
$this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient);
}

public function testCreateGroup()
{
$group = new \MessageBird\Objects\Group();
Expand Down
6 changes: 0 additions & 6 deletions tests/Integration/Hlr/HlrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

class HlrTest extends BaseTest
{
protected function setUp()
{
parent::setUp();
$this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient);
}

public function testCreateHlr()
{
$this->expectException(\MessageBird\Exceptions\ServerException::class);
Expand Down
6 changes: 0 additions & 6 deletions tests/Integration/Lookup/LookupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

class LookupTest extends BaseTest
{
protected function setUp()
{
parent::setUp();
$this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient);
}

public function testReadLookup()
{
$this->expectException(\MessageBird\Exceptions\ServerException::class);
Expand Down
6 changes: 0 additions & 6 deletions tests/Integration/Messages/MessagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

class MessageTest extends BaseTest
{
protected function setUp()
{
parent::setUp();
$this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient);
}

public function testCreateMessage()
{
$message = new \MessageBird\Objects\Message();
Expand Down
6 changes: 0 additions & 6 deletions tests/Integration/Numbers/AvailablePhoneNumbersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

class AvailablePhoneNumbersTest extends BaseTest
{
protected function setUp()
{
parent::setUp();
$this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient);
}

public function testListAvailablePhoneNumbers()
{
$this->expectException(\MessageBird\Exceptions\ServerException::class);
Expand Down
6 changes: 0 additions & 6 deletions tests/Integration/Numbers/PhoneNumbersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

class PhoneNumbersTest extends BaseTest
{
protected function setUp()
{
parent::setUp();
$this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient);
}

public function testReadPhoneNumber()
{
$this->expectException(\MessageBird\Exceptions\ServerException::class);
Expand Down
6 changes: 0 additions & 6 deletions tests/Integration/PartnerAccount/AccountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

class AccountTest extends BaseTest
{
protected function setUp()
{
parent::setUp();
$this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient);
}

public function testCreateSubAccount()
{
$account = new \MessageBird\Objects\PartnerAccount\Account();
Expand Down
6 changes: 0 additions & 6 deletions tests/Integration/Verify/VerifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

class VerifyTest extends BaseTest
{
protected function setUp()
{
parent::setUp();
$this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient);
}

public function testGenerateOtp()
{
$this->expectException(\MessageBird\Exceptions\ServerException::class);
Expand Down
9 changes: 0 additions & 9 deletions tests/Integration/Voice/VoiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@

class VoiceTest extends BaseTest
{
/** @var \MessageBird\Client client */
public $client;

protected function setUp()
{
parent::setUp();
$this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient);
}

public function testListVoiceCall()
{
$this->expectException(\MessageBird\Exceptions\ServerException::class);
Expand Down
6 changes: 0 additions & 6 deletions tests/Integration/VoiceMessages/VoiceMessagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

class VoiceMessagesTest extends BaseTest
{
protected function setUp()
{
parent::setUp();
$this->client = new \MessageBird\Client('YOUR_ACCESS_KEY', $this->mockClient);
}

public function testVoiceMessageCreate()
{
$this->expectException(\MessageBird\Exceptions\ServerException::class);
Expand Down

0 comments on commit b0ea00b

Please sign in to comment.