|
@@ -84,10 +84,12 @@ class BitmaskedBehaviorTest extends TestCase {
|
|
|
*/
|
|
*/
|
|
|
public function testFindBitmasked() {
|
|
public function testFindBitmasked() {
|
|
|
$res = $this->Comments->find('bits', ['bits' => []])->toArray();
|
|
$res = $this->Comments->find('bits', ['bits' => []])->toArray();
|
|
|
- $this->assertSame([], $res);
|
|
|
|
|
|
|
+ $this->assertCount(1, $res);
|
|
|
|
|
+ $this->assertSame([], $res[0]->statuses);
|
|
|
|
|
|
|
|
$res = $this->Comments->find('bits', ['bits' => [BitmaskedComment::STATUS_ACTIVE, BitmaskedComment::STATUS_APPROVED]])->toArray();
|
|
$res = $this->Comments->find('bits', ['bits' => [BitmaskedComment::STATUS_ACTIVE, BitmaskedComment::STATUS_APPROVED]])->toArray();
|
|
|
$this->assertCount(1, $res);
|
|
$this->assertCount(1, $res);
|
|
|
|
|
+ $this->assertSame([BitmaskedComment::STATUS_ACTIVE, BitmaskedComment::STATUS_APPROVED], $res[0]->statuses);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -95,6 +97,14 @@ class BitmaskedBehaviorTest extends TestCase {
|
|
|
*/
|
|
*/
|
|
|
public function testFindBitmaskedContain() {
|
|
public function testFindBitmaskedContain() {
|
|
|
$options = [
|
|
$options = [
|
|
|
|
|
+ 'bits' => [],
|
|
|
|
|
+ 'type' => 'contain'
|
|
|
|
|
+ ];
|
|
|
|
|
+ $res = $this->Comments->find('bits', $options)->toArray();
|
|
|
|
|
+ $this->assertCount(1, $res);
|
|
|
|
|
+ $this->assertSame([], $res[0]->statuses);
|
|
|
|
|
+
|
|
|
|
|
+ $options = [
|
|
|
'bits' => [BitmaskedComment::STATUS_APPROVED],
|
|
'bits' => [BitmaskedComment::STATUS_APPROVED],
|
|
|
'type' => 'contain'
|
|
'type' => 'contain'
|
|
|
];
|
|
];
|