SoftDelete\Test\TestCase\Model\Table\SoftDeleteBehaviorTest::testHardDeleteAll PHP Метод

testHardDeleteAll() публичный Метод

Tests hardDeleteAll.
public testHardDeleteAll ( )
    public function testHardDeleteAll()
    {
        $affectedRows = $this->postsTable->hardDeleteAll(new \DateTime('now'));
        $this->assertEquals(0, $affectedRows);
        $postsRowsCount = $this->postsTable->find('all', ['withDeleted'])->count();
        $this->postsTable->delete($this->postsTable->get(1));
        $affectedRows = $this->postsTable->hardDeleteAll(new \DateTime('now'));
        $this->assertEquals(1, $affectedRows);
        $newpostsRowsCount = $this->postsTable->find('all', ['withDeleted'])->count();
        $this->assertEquals($postsRowsCount - 1, $newpostsRowsCount);
    }