JamesMoss\Flywheel\RespositoryTest::testRenamingDocumentChangesDocumentID PHP Method

testRenamingDocumentChangesDocumentID() public method

    public function testRenamingDocumentChangesDocumentID()
    {
        if (!is_dir('/tmp/flywheel')) {
            mkdir('/tmp/flywheel');
        }
        $config = new Config('/tmp/flywheel');
        $repo = new Repository('_pages', $config);
        $doc = new Document(array('test' => '123'));
        $doc->setId('testdoc123');
        $repo->store($doc);
        rename('/tmp/flywheel/_pages/testdoc123.json', '/tmp/flywheel/_pages/newname.json');
        foreach ($repo->findAll() as $document) {
            if ('newname' === $document->getId()) {
                return true;
            }
        }
        $this->fail('No file found with the new ID');
    }