/** * @test * @group library */ public function isValidShouldReturnFalseForEmptyPagePrivilege() { $pageWithEmptyPrevilege = array('PAGE-0db7eaa7-7fc5-464a-bd47-16b3b8af00af-PAGE' => array('edit'), 'PAGE-0db7eaa7-7fc5-464a-bd47-16b3b8af00ag-PAGE' => array()); $pageWithEmptyPrevilegeJsonString = json_encode($pageWithEmptyPrevilege); $pageWithEmptyPrevilegeObject = json_decode($pageWithEmptyPrevilegeJsonString); $rightsValidator = new PageRightsValidator(); $this->assertFalse($rightsValidator->isValid($pageWithEmptyPrevilegeObject)); $validationErrors = $rightsValidator->getErrors(); $this->assertSame(1, count($validationErrors)); $this->assertSame(PageRightsValidator::INVALID_EMPTY_PRIVILEGE, $validationErrors[0]); }