Closed ElectricMaxxx closed 8 years ago
Except the setUp() there is no funktional test for PhpcrRepository
.
@dantleech any reasons why the PhpcrRepository has no functional tests in here?
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.
Will try to do that. Still fixed the abstraction locally.
@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.
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');
}
}
Sure. Mostly you see the equality when still written. I thing Get with the getNodeName()/getName() assert on the payload is the main difference.
Can we do the major style forced changes (Licence date and []) in a separate PR and rebase mine on top?
you can remove 5.3 and 5.4 support.
Applied StyleCI to master, you can rebase.
@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?
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
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
Oh. That was really fast. Will do it tonight.
Replaced by #31
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.