Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chupocabra committed Feb 28, 2024
1 parent 4f15373 commit f5f165f
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions tests/Bot/Tests/DialogsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,37 @@ public function testDialogClose()
self::assertEmpty($response->getErrors());
}

/**
* @group("dialogs")
* @throws \Exception
*/
public function testDialogAddTagError()
{
self::expectException(NotFoundException::class);

$client = self::getApiClient(
null,
null,
false,
$this->getErrorsResponse(404,
"'color_code can contain only the following values: " .
"light-red; light-blue; light-green; light-orange; light-gray; " .
"light-grayish-blue; red; blue; green; orange; gray; grayish-blue'"
)
);

$tags[0] = new Tag();
$tags[0]->setName('tag1');
$tags[0]->setColorCode('qwerty');

$request = new DialogTagRequest();
$request->setDialogId(60);
$request->setTags($tags);

$response = $client->dialogAddTag($request);
self::assertEmpty($response->getErrors());
}

/**
* @group("dialogs")
* @throws \Exception
Expand Down Expand Up @@ -179,6 +210,28 @@ public function testDialogAddTag()
self::assertEmpty($response->getErrors());
}

/**
* @group("dialogs")
* @throws \Exception
*/
public function testDialogDeleteTagError()
{
$this->expectException(\TypeError::class);

$client = self::getApiClient(
null,
null,
false,
);

$tags[0] = new Tag();

$request = new DialogTagRequest();
$request->setTags($tags);

$client->dialogDeleteTag($request);
}

/**
* @group("dialogs")
* @throws \Exception
Expand Down

0 comments on commit f5f165f

Please sign in to comment.