JamesMoss\Flywheel\NestedRespositoryTest::testDeletingDocuments PHP Method

testDeletingDocuments() public method

    public function testDeletingDocuments()
    {
        exec('rm -rf /tmp/flywheel/_pages');
        $config = new Config('/tmp/flywheel');
        $repo = new NestedRepository('_pages', $config);
        $id = 'delete_test/within/a/nested/directory';
        $name = $id . '.json';
        $path = '/tmp/flywheel/_pages/' . $name;
        mkdir(dirname($path), 0777, true);
        file_put_contents($path, '');
        $this->assertTrue(is_file($path));
        $repo->delete($id);
        $this->assertFalse(is_file($path));
    }