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;
|
private $user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="boolean", options={"default" = 0})
|
* @ORM\Column(name="is_read", type="boolean", options={"default" = 0})
|
||||||
*/
|
*/
|
||||||
private $isRead = false;
|
private $isRead = false;
|
||||||
|
|
||||||
|
@@ -65,7 +65,7 @@ class BasketRepository extends EntityRepository
|
|||||||
LEFT JOIN s.participants p
|
LEFT JOIN s.participants p
|
||||||
WHERE b.archived = false
|
WHERE b.archived = false
|
||||||
AND (
|
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
|
OR (b.user != :usr_id_ownertwo
|
||||||
AND p.user = :usr_id_participant
|
AND p.user = :usr_id_participant
|
||||||
AND p.is_aware = false)
|
AND p.is_aware = false)
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Alchemy\Tests\Phrasea\Controller\Root;
|
namespace Alchemy\Tests\Phrasea\Controller\Root;
|
||||||
|
|
||||||
|
use Alchemy\Phrasea\Model\Entities\User;
|
||||||
use Symfony\Component\HttpKernel\Client;
|
use Symfony\Component\HttpKernel\Client;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,16 +45,19 @@ class SessionTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
*/
|
*/
|
||||||
public function testUpdSession()
|
public function testUpdSession()
|
||||||
{
|
{
|
||||||
$this->authenticate(self::$DI['app']);
|
$this->authenticate($this->getApplication());
|
||||||
|
|
||||||
|
/** @var User $user */
|
||||||
|
$user = self::$DI['user'];
|
||||||
$this->XMLHTTPRequest('POST', '/session/update/', [
|
$this->XMLHTTPRequest('POST', '/session/update/', [
|
||||||
'usr' => self::$DI['user']->getId(),
|
'usr' => $user->getId(),
|
||||||
'module' => 1
|
'module' => 1
|
||||||
]);
|
]);
|
||||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
$client = $this->getClient();
|
||||||
$datas = json_decode(self::$DI['client']->getResponse()->getContent());
|
$this->assertTrue($client->getResponse()->isOk());
|
||||||
$this->checkSessionReturn($datas);
|
$data = json_decode($client->getResponse()->getContent());
|
||||||
$this->assertEquals('ok', $datas->status);
|
$this->checkSessionReturn($data);
|
||||||
|
$this->assertEquals('ok', $data->status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user