smaller PM tests
This commit is contained in:
@ -6,7 +6,7 @@ namespace Shimmie2;
|
|||||||
|
|
||||||
class PrivMsgTest extends ShimmiePHPUnitTestCase
|
class PrivMsgTest extends ShimmiePHPUnitTestCase
|
||||||
{
|
{
|
||||||
public function testPM()
|
public function testUserReadOwnMessage()
|
||||||
{
|
{
|
||||||
// Send from admin to user
|
// Send from admin to user
|
||||||
$this->log_in_as_admin();
|
$this->log_in_as_admin();
|
||||||
@ -17,10 +17,6 @@ class PrivMsgTest extends ShimmiePHPUnitTestCase
|
|||||||
"message demo to test"
|
"message demo to test"
|
||||||
)));
|
)));
|
||||||
|
|
||||||
// Check that admin can see user's messages
|
|
||||||
$this->get_page("user/" . self::$user_name);
|
|
||||||
$this->assert_text("message demo to test");
|
|
||||||
|
|
||||||
// Check that user can see own messages
|
// Check that user can see own messages
|
||||||
$this->log_in_as_user();
|
$this->log_in_as_user();
|
||||||
$this->get_page("user");
|
$this->get_page("user");
|
||||||
@ -39,4 +35,20 @@ class PrivMsgTest extends ShimmiePHPUnitTestCase
|
|||||||
// $this->get_page("pm/read/0");
|
// $this->get_page("pm/read/0");
|
||||||
// $this->assert_text("No such PM");
|
// $this->assert_text("No such PM");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testAdminReadOtherMessage()
|
||||||
|
{
|
||||||
|
// Send from admin to user
|
||||||
|
$this->log_in_as_admin();
|
||||||
|
send_event(new SendPMEvent(new PM(
|
||||||
|
User::by_name(self::$admin_name)->id,
|
||||||
|
"0.0.0.0",
|
||||||
|
User::by_name(self::$user_name)->id,
|
||||||
|
"message demo to test"
|
||||||
|
)));
|
||||||
|
|
||||||
|
// Check that admin can see user's messages
|
||||||
|
$this->get_page("user/" . self::$user_name);
|
||||||
|
$this->assert_text("message demo to test");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user