Files
roundcubemail/tests/Actions/Contacts/Photo.php
Michael Voříšek 6a53a1d853 Fix CS (whitespace, visibility) (#9297)
* Fix "method_argument_space"

* Fix "control_structure_continuation_position"

* Fix "new_with_parentheses"

* Fix "blank_line_before_statement"

* Fix "visibility_required"

* Fix some "array_indentation"

* Fix some "array_indentation" - unify all "rcube::raise_error" calls

* rm useless eslint ignores and add rules counts

* sort eslint ignores

* fix eslint ignores grammar

* Revert "Fix "blank_line_before_statement""

* fix CS 3.46.0
2024-01-04 14:26:35 +01:00

44 lines
1.1 KiB
PHP

<?php
/**
* Test class to test rcmail_action_contacts_photo
*/
class Actions_Contacts_Photo extends ActionTestCase
{
/**
* Test run() method - no photo case
*/
public function test_no_photo()
{
$action = new rcmail_action_contacts_photo();
$output = $this->initOutput(rcmail_action::MODE_HTTP, 'contacts', 'photo');
$this->assertInstanceOf('rcmail_action', $action);
$this->assertTrue($action->checks());
$this->runAndAssert($action, OutputJsonMock::E_EXIT);
$result = $output->getOutput();
$this->assertSame(['Content-Type: image/gif'], $output->headers);
$this->assertSame(base64_decode(rcmail_output::BLANK_GIF), $result);
$_GET = ['_error' => 1];
$this->runAndAssert($action, OutputJsonMock::E_EXIT);
$result = $output->getOutput();
$this->assertSame(['HTTP/1.0 204 Photo not found'], $output->headers);
$this->assertSame('', $result);
}
/**
* Test run() method - a contact with real photo
*/
public function test_photo()
{
$this->markTestIncomplete();
}
}