<commit_before><?php

require_once __DIR__.'/../../vendor/phpcr/phpcr-api-tests/inc/AbstractLoader.php';

/**
 * Implementation loader for jackalope-doctrine-dbal
 */
class ImplementationLoader extends \PHPCR\Test\AbstractLoader
{
    private static $instance = null;

    protected function __construct()
    {
        parent::__construct('Jackalope\RepositoryFactoryDoctrineDBAL', $GLOBALS['phpcr.workspace']);

        $this->unsupportedChapters = array(
                    'PermissionsAndCapabilities',
                    'Observation',
                    'ShareableNodes',
                    'Versioning',
                    'AccessControlManagement',
                    'Locking',
                    'LifecycleManagement',
                    'RetentionAndHold',
                    'SameNameSiblings',
                    'OrderableChildNodes',
        );

        $this->unsupportedCases = array(
                    'Writing\\MoveMethodsTest',
                    'Query\\XPath',
                    'Query\\Sql1'
        );

        $this->unsupportedTests = array(
                    'Connecting\\RepositoryTest::testLoginException', //TODO: figure out what would be invalid credentials

                    'Reading\\NodeReadMethodsTest::testGetSharedSetUnreferenced', // TODO: should this be moved to 14_ShareableNodes
                    'Reading\\SessionReadMethodsTest::testImpersonate', //TODO: Check if that's implemented in newer jackrabbit versions.
                    'Reading\\SessionNamespaceRemappingTest::testSetNamespacePrefix', //TODO: implement session scope remapping of namespaces
                    'Reading\\PropertyReadMethodsTest::testJcrCreated', // TODO: fails because NodeTypeDefinitions do not work inside DoctrineDBAL transport yet.

                    //TODO: implement getQuery method in Jackalope QueryManager
                    'Query\\QueryManagerTest::testGetQuery',
                    'Query\\QueryManagerTest::testGetQueryInvalid',
                    'Query\\QueryObjectSql2Test::testGetStoredQueryPath',

                    //call to undefined method Jackalope\Query\QOM\Join::getNodeTypeName()
                    //in /jackalope-doctrine-dbal/src/Jackalope/Transport/DoctrineDBAL/Client.php on line 1513
                    'Query\\QuerySql2OperationsTest::testQueryJoin',
                    'Query\\QuerySql2OperationsTest::testQueryJoinReference',

                    // this seems a bug in php with arrayiterator - and jackalope is using
                    // arrayiterator for the search result
                    // https://github.com/phpcr/phpcr-api-tests/issues/22
                    'Query\\NodeViewTest::testSeekable',

                    'Writing\\AddMethodsTest::testAddNodeIllegalType',
                    'Writing\\AddMethodsTest::testAddNodeInParallel',
                    'Writing\\AddMethodsTest::testAddPropertyWrongType',
                    'Writing\\CopyMethodsTest::testCopyUpdateOnCopy',
                    'Writing\\CopyMethodsTest::testWorkspaceCopy',
                    'Writing\\MoveMethodsTest::testSessionDeleteMoved', // TODO: enable and look at the exception you get as starting point
                    'Writing\\MoveMethodsTest::testNodeOrderBeforeEnd',
                    'Writing\\MoveMethodsTest::testNodeOrderBeforeDown',
                    'Writing\\MoveMethodsTest::testNodeOrderBeforeUp',
                    'Writing\\DeleteMethodsTest::testRemoveNodeConstraintViolation',
                    'Writing\\DeleteMethodsTest::testNodeRemovePropertyConstraintViolation',
                    'Writing\\CombinedManipulationsTest::testRemoveAndMove',
                    'Writing\\CombinedManipulationsTest::testAddAndChildAddAndMove',
                    'Writing\\CombinedManipulationsTest::testMoveSessionRefreshKeepChanges',

                    'Transactions\\TransactionMethodsTest::testInTransaction',
                    'Transactions\\TransactionMethodsTest::testTransactionCommit',
                    'Transactions\\TransactionMethodsTest::testTransactionRollback',

                    'WorkspaceManagement\\WorkspaceManagementTest::testCreateWorkspaceWithSource',
                    'WorkspaceManagement\\WorkspaceManagementTest::testCreateWorkspaceWithInvalidSource',
                    'WorkspaceManagement\\WorkspaceManagementTest::testDeleteWorkspace',

                    //some import tests are skipped for now, issue opened: https://github.com/jackalope/jackalope-doctrine-dbal/issues/12
                    'Import\\ImportRepositoryContentTest::testImportXMLUuidReplaceExistingWorkspace',
                    'Import\\ImportRepositoryContentTest::testImportXMLUuidReplaceExistingSession',
                    'Import\\ImportRepositoryContentTest::testImportXMLUuidReplaceRoot',
        );

    }

    public static function getInstance()
    {
        if (null === self::$instance) {
            self::$instance = new ImplementationLoader();
        }
        return self::$instance;
    }

    public function getRepositoryFactoryParameters()
    {
        global $dbConn; // initialized in bootstrap_doctrine_dbal.php
        return array('jackalope.doctrine_dbal_connection' => $dbConn);
    }

    public function getCredentials()
    {
        return new \PHPCR\SimpleCredentials($GLOBALS['phpcr.user'], $GLOBALS['phpcr.pass']);
    }

    public function getInvalidCredentials()
    {
        return new \PHPCR\SimpleCredentials('nonexistinguser', '');
    }

    public function getRestrictedCredentials()
    {<commit_msg>Updating the test loader with current application state<commit_after><?php

require_once __DIR__.'/../../vendor/phpcr/phpcr-api-tests/inc/AbstractLoader.php';

/**
 * Implementation loader for jackalope-doctrine-dbal
 */
class ImplementationLoader extends \PHPCR\Test\AbstractLoader
{
    private static $instance = null;

    protected function __construct()
    {
        parent::__construct('Jackalope\RepositoryFactoryDoctrineDBAL', $GLOBALS['phpcr.workspace']);

        $this->unsupportedChapters = array(
                    'PermissionsAndCapabilities', //TODO: Transport does not support permissions
                    'Observation', //TODO: Transport does not support observation
                    'Versioning', //TODO: Transport does not support versioning
                    'Locking', //TODO: Transport does not support locking
        );

        $this->unsupportedCases = array(
                    'Writing\\MoveMethodsTest', //TODO: Moving nodes is not yet implemented
                    'Query\\XPath', //TODO: Query language 'xpath' not yet implemented.
                    'Query\\Sql1' //TODO: Query language 'sql' not yet implemented
        );

        $this->unsupportedTests = array(
                    'Connecting\\RepositoryTest::testLoginException', //TODO: figure out what would be invalid credentials

                    'Reading\\NodeReadMethodsTest::testGetSharedSetUnreferenced', // TODO: should this be moved to 14_ShareableNodes
                    'Reading\\SessionReadMethodsTest::testImpersonate', //TODO: Check if that's implemented in newer jackrabbit versions.
                    'Reading\\SessionNamespaceRemappingTest::testSetNamespacePrefix', //TODO: implement session scope remapping of namespaces
                    'Reading\\PropertyReadMethodsTest::testJcrCreated', // TODO: fails because NodeTypeDefinitions do not work inside DoctrineDBAL transport yet.

                    //TODO: implement getQuery method in Jackalope QueryManager
                    'Query\\QueryManagerTest::testGetQuery',
                    'Query\\QueryManagerTest::testGetQueryInvalid',
                    'Query\\QueryObjectSql2Test::testGetStoredQueryPath',

                    //TODO: https://github.com/jackalope/jackalope-doctrine-dbal/issues/15
                    'Query\\QuerySql2OperationsTest::testQueryJoin',
                    'Query\\QuerySql2OperationsTest::testQueryJoinReference',

                    // this seems a bug in php with arrayiterator - and jackalope is using
                    // arrayiterator for the search result
                    // https://github.com/phpcr/phpcr-api-tests/issues/22
                    'Query\\NodeViewTest::testSeekable',

                    'Writing\\AddMethodsTest::testAddNodeIllegalType', //TODO: https://github.com/jackalope/jackalope-doctrine-dbal/issues/16
                    'Writing\\AddMethodsTest::testAddNodeInParallel',  //TODO: https://github.com/jackalope/jackalope-doctrine-dbal/issues/17
                    'Writing\\AddMethodsTest::testAddPropertyWrongType', //TODO: https://github.com/jackalope/jackalope-doctrine-dbal/issues/18
                    'Writing\\CopyMethodsTest::testCopyUpdateOnCopy', //TODO: update-on-copy is currently not supported
                    'Writing\\CopyMethodsTest::testWorkspaceCopy', //TODO: https://github.com/jackalope/jackalope-doctrine-dbal/issues/19
                    'Writing\\MoveMethodsTest::testSessionDeleteMoved', // TODO: enable and look at the exception you get as starting point
                    'Writing\\DeleteMethodsTest::testRemoveNodeConstraintViolation', //TODO: https://github.com/jackalope/jackalope-doctrine-dbal/issues/20
                    'Writing\\DeleteMethodsTest::testNodeRemovePropertyConstraintViolation', //TODO: https://github.com/jackalope/jackalope-doctrine-dbal/issues/21

                    //TODO: moving nodes is not implemented yet
                    'Writing\\CombinedManipulationsTest::testRemoveAndMove',
                    'Writing\\CombinedManipulationsTest::testAddAndChildAddAndMove',
                    'Writing\\CombinedManipulationsTest::testMoveSessionRefreshKeepChanges',

                    //TODO: https://github.com/jackalope/jackalope-doctrine-dbal/issues/22
                    'Transactions\\TransactionMethodsTest::testTransactionCommit',

                    //TODO: Client::createWorkspace throws a NotImplementedException
                    'WorkspaceManagement\\WorkspaceManagementTest::testCreateWorkspaceWithSource',
                    'WorkspaceManagement\\WorkspaceManagementTest::testCreateWorkspaceWithInvalidSource',
                    'WorkspaceManagement\\WorkspaceManagementTest::testDeleteWorkspace',

                    //TODO: https://github.com/jackalope/jackalope-doctrine-dbal/issues/12
                    'Import\\ImportRepositoryContentTest::testImportXMLUuidReplaceExistingWorkspace',
                    'Import\\ImportRepositoryContentTest::testImportXMLUuidReplaceExistingSession',
                    'Import\\ImportRepositoryContentTest::testImportXMLUuidReplaceRoot',
        );
    }

    public static function getInstance()
    {
        if (null === self::$instance) {
            self::$instance = new ImplementationLoader();
        }
        return self::$instance;
    }

    public function getRepositoryFactoryParameters()
    {
        global $dbConn; // initialized in bootstrap_doctrine_dbal.php
        return array('jackalope.doctrine_dbal_connection' => $dbConn);
    }

    public function getCredentials()
    {
        return new \PHPCR\SimpleCredentials($GLOBALS['phpcr.user'], $GLOBALS['phpcr.pass']);
    }

    public function getInvalidCredentials()
    {
        return new \PHPCR\SimpleCredentials('nonexistinguser', '');
    }

    public function getRestrictedCredentials()
    {
{'fraction_non_alphanumeric': 0.0965342201995449, 'fraction_numerical': 0.003500787677227376, 'mean_word_length': 2.368808962264151, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '817271', 'n_tokens_mistral': 2844, 'n_tokens_neox': 2680, 'n_words': 479}