mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Change read status of Basket in Repository
This commit is contained in:
@@ -53,7 +53,7 @@ class Basket
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default" = 0})
|
||||
* @ORM\Column(name="is_read", type="boolean", options={"default" = 0})
|
||||
*/
|
||||
private $isRead = false;
|
||||
|
||||
|
@@ -65,7 +65,7 @@ class BasketRepository extends EntityRepository
|
||||
LEFT JOIN s.participants p
|
||||
WHERE b.archived = false
|
||||
AND (
|
||||
(b.user = :usr_id_owner AND b.is_read = false)
|
||||
(b.user = :usr_id_owner AND b.isRead = false)
|
||||
OR (b.user != :usr_id_ownertwo
|
||||
AND p.user = :usr_id_participant
|
||||
AND p.is_aware = false)
|
||||
|
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Alchemy\Tests\Phrasea\Controller\Root;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\User;
|
||||
use Symfony\Component\HttpKernel\Client;
|
||||
|
||||
/**
|
||||
@@ -44,16 +45,19 @@ class SessionTest extends \PhraseanetAuthenticatedWebTestCase
|
||||
*/
|
||||
public function testUpdSession()
|
||||
{
|
||||
$this->authenticate(self::$DI['app']);
|
||||
$this->authenticate($this->getApplication());
|
||||
|
||||
/** @var User $user */
|
||||
$user = self::$DI['user'];
|
||||
$this->XMLHTTPRequest('POST', '/session/update/', [
|
||||
'usr' => self::$DI['user']->getId(),
|
||||
'usr' => $user->getId(),
|
||||
'module' => 1
|
||||
]);
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||
$datas = json_decode(self::$DI['client']->getResponse()->getContent());
|
||||
$this->checkSessionReturn($datas);
|
||||
$this->assertEquals('ok', $datas->status);
|
||||
$client = $this->getClient();
|
||||
$this->assertTrue($client->getResponse()->isOk());
|
||||
$data = json_decode($client->getResponse()->getContent());
|
||||
$this->checkSessionReturn($data);
|
||||
$this->assertEquals('ok', $data->status);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user