symfony-cmf / resource-bundle

Resource Location for CMF documents based on Puli
https://cmf.symfony.com
5 stars 7 forks source link

[WIP] Test move add remove #22

Closed ElectricMaxxx closed 8 years ago

ElectricMaxxx commented 8 years ago

Merge when https://github.com/symfony-cmf/resource/pull/17 is merged.

Implemented tests on the editable repository created through the PR on resource component. reference change in composer.json will be removed.

ElectricMaxxx commented 8 years ago

Except the setUp() there is no funktional test for PhpcrRepository.

ElectricMaxxx commented 8 years ago

@dantleech any reasons why the PhpcrRepository has no functional tests in here?

dantleech commented 8 years ago

It is wrong, I was probably planning to move the tests to the AbstractPhpcrTestCase and extend both cases from that. The current tests would be identical for both. The setUps would be different.

ElectricMaxxx commented 8 years ago

Will try to do that. Still fixed the abstraction locally.

ElectricMaxxx commented 8 years ago

@Dantleech i currently do Not know how create a pure node instance on the easy way to pass it to the PhpcResource without touching the session.

dantleech commented 8 years ago

You can move much more to the AbstractPhpcrTestCase I think.


class AbstractPhpcrTestCase extends \...
{
    private $session;

    public function setUp()
    {
        $this->session = // .. get PHPCR session
    }

    protected abstract function getRepository();

    public function testAddSomething()
    {
         $node = $this->session->getRoot()->addNode('foo');
         $resource = new PhpcrResource($node); // or whatever
         $this->getRepository()->add($resource, 'hello');

         $this->session->getNode('/hello');
    }

    public functoin testMoveSomething()
    {
         $this->getRepository()->move($resource, '/foo', '/bar');

         // PHPCR will throw an exception if /bar does not exist.
         $this->session->getNode('/bar');
    }

    // .. etc. All the tests are in this class.
}

so that each test case could be as little as:

class PhpcrTest extends AbstractPhpcrTestCase
{
    protected function getRepository()
    {
        return $this->registry->get('phpcr_test');
    }
}
ElectricMaxxx commented 8 years ago

Sure. Mostly you see the equality when still written. I thing Get with the getNodeName()/getName() assert on the payload is the main difference.

ElectricMaxxx commented 8 years ago

Can we do the major style forced changes (Licence date and []) in a separate PR and rebase mine on top?

dantleech commented 8 years ago

you can remove 5.3 and 5.4 support.

dantleech commented 8 years ago

Applied StyleCI to master, you can rebase.

ElectricMaxxx commented 8 years ago

@dantleech I needed to squash for the rebas of 10 commits, but i got an esception for the phpcr configuration now:

Invalid configuration for repository "test_repository_phpcr"
 /home/maximilian/OpenSource/Cmf/resource-bundle/DependencyInjection/CmfResourceExtension.php:77
 /home/maximilian/OpenSource/Cmf/resource-bundle/DependencyInjection/CmfResourceExtension.php:50
 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:55
 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php:39
 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:104
 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:593
 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:511
 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:133
 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php:146
 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php:33
 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony-cmf/testing/src/Functional/BaseTestCase.php:67
 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony-cmf/testing/src/Functional/BaseTestCase.php:81
 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony-cmf/testing/src/Functional/BaseTestCase.php:122
 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony-cmf/testing/src/Functional/BaseTestCase.php:94
 /home/maximilian/OpenSource/Cmf/resource-bundle/Tests/Functional/RepositoryTestCase.php:41

The option resolver throws:

The option "basepath" does not exist. Defined options are: "basedir".
``
had there been a change on the configuration?
dantleech commented 8 years ago

It should be basepath. Looks like I made a bug, will try and fix it this afternoon.

On Fri, May 27, 2016 at 06:30:29AM -0700, Maximilian Berghoff wrote:

[1]@dantleech I needed to squash for the rebas of 10 commits, but i got an esception for the phpcr configuration now:

Invalid configuration for repository "test_repository_phpcr" /home/maximilian/OpenSource/Cmf/resource-bundle/DependencyInjection/CmfResourceExtension.php:77 /home/maximilian/OpenSource/Cmf/resource-bundle/DependencyInjection/CmfResourceExtension.php:50 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:55 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php:39 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:104 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:593 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:511 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:133 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php:146 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php:33 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony-cmf/testing/src/Functional/BaseTestCase.php:67 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony-cmf/testing/src/Functional/BaseTestCase.php:81 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony-cmf/testing/src/Functional/BaseTestCase.php:122 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony-cmf/testing/src/Functional/BaseTestCase.php:94 /home/maximilian/OpenSource/Cmf/resource-bundle/Tests/Functional/RepositoryTestCase.php:41

The option resolver throws:

The option "basepath" does not exist. Defined options are: "basedir". `` had there been a change on the configuration?

— You are receiving this because you were mentioned. Reply to this email directly, [2]view it on GitHub, or [3]mute the thread.

Reverse link: [4]unknown

References

Visible links

  1. https://github.com/dantleech
  2. https://github.com/symfony-cmf/resource-bundle/pull/22#issuecomment-222146614
  3. https://github.com/notifications/unsubscribe/AAgZcb1WVt_jkgxoa-Tmq0SGkaYxSxVIks5qFvH1gaJpZM4Il7C1
  4. https://github.com/symfony-cmf/resource-bundle/pull/22#issuecomment-222146614
dantleech commented 8 years ago

Fixed, you can rebase again ...

On Fri, May 27, 2016 at 06:30:29AM -0700, Maximilian Berghoff wrote:

[1]@dantleech I needed to squash for the rebas of 10 commits, but i got an esception for the phpcr configuration now:

Invalid configuration for repository "test_repository_phpcr" /home/maximilian/OpenSource/Cmf/resource-bundle/DependencyInjection/CmfResourceExtension.php:77 /home/maximilian/OpenSource/Cmf/resource-bundle/DependencyInjection/CmfResourceExtension.php:50 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:55 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php:39 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:104 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:593 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:511 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:133 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php:146 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php:33 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony-cmf/testing/src/Functional/BaseTestCase.php:67 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony-cmf/testing/src/Functional/BaseTestCase.php:81 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony-cmf/testing/src/Functional/BaseTestCase.php:122 /home/maximilian/OpenSource/Cmf/resource-bundle/vendor/symfony-cmf/testing/src/Functional/BaseTestCase.php:94 /home/maximilian/OpenSource/Cmf/resource-bundle/Tests/Functional/RepositoryTestCase.php:41

The option resolver throws:

The option "basepath" does not exist. Defined options are: "basedir". `` had there been a change on the configuration?

— You are receiving this because you were mentioned. Reply to this email directly, [2]view it on GitHub, or [3]mute the thread.

Reverse link: [4]unknown

References

Visible links

  1. https://github.com/dantleech
  2. https://github.com/symfony-cmf/resource-bundle/pull/22#issuecomment-222146614
  3. https://github.com/notifications/unsubscribe/AAgZcb1WVt_jkgxoa-Tmq0SGkaYxSxVIks5qFvH1gaJpZM4Il7C1
  4. https://github.com/symfony-cmf/resource-bundle/pull/22#issuecomment-222146614
ElectricMaxxx commented 8 years ago

Oh. That was really fast. Will do it tonight.

dantleech commented 8 years ago

Replaced by #31