From 889765b1304ea7ee8255e2195c9c8130aab8a696 Mon Sep 17 00:00:00 2001 From: Pratiksha Date: Mon, 17 Feb 2025 12:50:26 +0530 Subject: [PATCH 01/11] winp --- src/Neo4jQueryAPI.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Neo4jQueryAPI.php b/src/Neo4jQueryAPI.php index 3808b1d1..b0cb8219 100644 --- a/src/Neo4jQueryAPI.php +++ b/src/Neo4jQueryAPI.php @@ -44,8 +44,6 @@ public static function login(string $address, AuthenticateInterface $auth = null ); } - - /** * Executes a Cypher query. */ From bc53a5cf6e93bc0844d17a3e70456c7b830de846 Mon Sep 17 00:00:00 2001 From: Pratiksha Date: Mon, 17 Feb 2025 13:20:31 +0530 Subject: [PATCH 02/11] Expose-Configuration via Constructor Injection with Optional Factory Method --- src/Neo4jQueryAPI.php | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/Neo4jQueryAPI.php b/src/Neo4jQueryAPI.php index b0cb8219..4aa209c4 100644 --- a/src/Neo4jQueryAPI.php +++ b/src/Neo4jQueryAPI.php @@ -7,6 +7,7 @@ use Neo4j\QueryAPI\Exception\Neo4jException; use Neo4j\QueryAPI\Objects\Authentication; use Neo4j\QueryAPI\Results\ResultSet; +use Neo4j\QueryAPI\Configuration; use Nyholm\Psr7\Factory\Psr17Factory; use Psr\Http\Client\ClientInterface; use Psr\Http\Client\RequestExceptionInterface; @@ -14,36 +15,43 @@ class Neo4jQueryAPI { + private Configuration $config; + public function __construct( private ClientInterface $client, private ResponseParser $responseParser, - private Neo4jRequestFactory $requestFactory + private Neo4jRequestFactory $requestFactory, + ?Configuration $config = null ) { + $this->config = $config ?? new Configuration(getenv("NEO4J_ADDRESS")); // Default configuration if not provided } /** * @api */ - public static function login(string $address, AuthenticateInterface $auth = null): self + public static function login(string $address, ?AuthenticateInterface $auth = null, ?Configuration $config = null): self { $client = new Client(); + $config = $config ?? new Configuration(baseUri: $address); return new self( client: $client, - responseParser: new ResponseParser( - ogm: new OGM() - ), + responseParser: new ResponseParser(new OGM()), requestFactory: new Neo4jRequestFactory( psr17Factory: new Psr17Factory(), streamFactory: new Psr17Factory(), - configuration: new Configuration( - baseUri: $address - ), + configuration: $config, auth: $auth ?? Authentication::fromEnvironment() - ) + ), + config: $config ); } + public function getConfig(): Configuration + { + return $this->config; + } + /** * Executes a Cypher query. */ @@ -59,7 +67,6 @@ public function run(string $cypher, array $parameters = []): ResultSet return $this->responseParser->parseRunQueryResponse($response); } - /** * Starts a transaction. */ @@ -86,6 +93,7 @@ public function beginTransaction(): Transaction ); } + /** * Handles request exceptions by parsing error details and throwing a Neo4jException. * @@ -95,7 +103,7 @@ private function handleRequestException(RequestExceptionInterface $e): void { $response = $e->getResponse(); if ($response instanceof ResponseInterface) { - $errorResponse = json_decode((string)$response->getBody(), true); + $errorResponse = json_decode((string) $response->getBody(), true); throw Neo4jException::fromNeo4jResponse($errorResponse, $e); } From 7cf06a08ae64fda54a5cc444f43e0631d8b107ae Mon Sep 17 00:00:00 2001 From: Pratiksha Date: Mon, 17 Feb 2025 15:49:57 +0530 Subject: [PATCH 03/11] winp --- src/abc.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/abc.php diff --git a/src/abc.php b/src/abc.php new file mode 100644 index 00000000..d430365a --- /dev/null +++ b/src/abc.php @@ -0,0 +1,42 @@ +run($cypher); + +foreach ($resultSet as $row) { + $node = $row['n']; + + $properties = $node->getProperties(); + + if (isset($properties['title'])) { + echo "Movie Title: " . $properties['title'] . "\n"; + } else { + echo "Title not found.\n"; + } + + if (isset($properties['released'])) { + echo "Movie Year: " . $properties['released'] . "\n"; + } else { + echo "Year not found.\n"; + } +} From c241a5b77b50a88566578c6d64205615728d64f7 Mon Sep 17 00:00:00 2001 From: Pratiksha Date: Mon, 17 Feb 2025 18:09:52 +0530 Subject: [PATCH 04/11] winp --- src/Configuration.php | 17 ++++++++++ src/Neo4jQueryAPI.php | 7 ++++ tests/Integration/Neo4jQueryAPITest.php | 44 +++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 tests/Integration/Neo4jQueryAPITest.php diff --git a/src/Configuration.php b/src/Configuration.php index 2aa1c04e..af2bdcf1 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -2,11 +2,23 @@ namespace Neo4j\QueryAPI; +use InvalidArgumentException; use Neo4j\QueryAPI\Objects\Bookmarks; use Neo4j\QueryAPI\Enums\AccessMode; class Configuration { + /** + * Constructor for Configuration class. + * + * @param string $baseUri The base URI for the Neo4j instance. + * @param string $database The name of the database to connect to. + * @param bool $includeCounters Whether to include counters in the response. + * @param Bookmarks $bookmarks Bookmarks for tracking queries. + * @param AccessMode $accessMode The access mode for the connection (read/write). + * + * @throws InvalidArgumentException if $baseUri is empty. + */ public function __construct( public readonly string $baseUri, public readonly string $database = 'neo4j', @@ -14,5 +26,10 @@ public function __construct( public readonly Bookmarks $bookmarks = new Bookmarks([]), public readonly AccessMode $accessMode = AccessMode::WRITE, ) { + // Validate that baseUri is not empty + if (empty($this->baseUri)) { + throw new InvalidArgumentException("Address (baseUri) must be provided."); + } } } + diff --git a/src/Neo4jQueryAPI.php b/src/Neo4jQueryAPI.php index 4aa209c4..eb61850b 100644 --- a/src/Neo4jQueryAPI.php +++ b/src/Neo4jQueryAPI.php @@ -34,6 +34,12 @@ public static function login(string $address, ?AuthenticateInterface $auth = nul $client = new Client(); $config = $config ?? new Configuration(baseUri: $address); + + /* if the user now passes a config object without an address it will break. + +$config = new Configuration(database: 'mydb'); + +QueryApi::login('http://myaddress', Authentication::fromEnvironment(), $config);*/ return new self( client: $client, responseParser: new ResponseParser(new OGM()), @@ -44,6 +50,7 @@ public static function login(string $address, ?AuthenticateInterface $auth = nul auth: $auth ?? Authentication::fromEnvironment() ), config: $config + ); } diff --git a/tests/Integration/Neo4jQueryAPITest.php b/tests/Integration/Neo4jQueryAPITest.php new file mode 100644 index 00000000..e03dcee1 --- /dev/null +++ b/tests/Integration/Neo4jQueryAPITest.php @@ -0,0 +1,44 @@ +expectException(InvalidArgumentException::class); + $this->expectExceptionMessage("Address (baseUri) must be provided."); + $config = new Configuration(baseUri: ""); + + Neo4jQueryAPI::login('http://myaddress', Authentication::fromEnvironment(), $config); + } + + public function testLoginWithValidConfiguration() + { + $config = new Configuration(baseUri: 'http://valid.address'); + + $api = Neo4jQueryAPI::login('http://myaddress', Authentication::fromEnvironment(), $config); + + $this->assertInstanceOf(Neo4jQueryAPI::class, $api); + $this->assertEquals('http://valid.address', $config->baseUri); + } + public function testLoginWithEmptyAddress() + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage("Address (baseUri) must be provided."); + + $config = new Configuration(baseUri: ""); + + Neo4jQueryAPI::login('http://myaddress', Authentication::fromEnvironment(), $config); + } + /** + * Test to ensure that an exception is thrown when baseUri is empty. + */ + + +} From 76cdf8a970b12391b114a5dbed83cd58696344a7 Mon Sep 17 00:00:00 2001 From: Pratiksha Date: Mon, 17 Feb 2025 18:46:05 +0530 Subject: [PATCH 05/11] winp --- src/Configuration.php | 1 - src/Neo4jQueryAPI.php | 4 ++-- tests/Integration/Neo4jQueryAPITest.php | 20 +++++++++++++++++--- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/Configuration.php b/src/Configuration.php index af2bdcf1..d0a0b233 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -26,7 +26,6 @@ public function __construct( public readonly Bookmarks $bookmarks = new Bookmarks([]), public readonly AccessMode $accessMode = AccessMode::WRITE, ) { - // Validate that baseUri is not empty if (empty($this->baseUri)) { throw new InvalidArgumentException("Address (baseUri) must be provided."); } diff --git a/src/Neo4jQueryAPI.php b/src/Neo4jQueryAPI.php index eb61850b..250d544c 100644 --- a/src/Neo4jQueryAPI.php +++ b/src/Neo4jQueryAPI.php @@ -23,13 +23,13 @@ public function __construct( private Neo4jRequestFactory $requestFactory, ?Configuration $config = null ) { - $this->config = $config ?? new Configuration(getenv("NEO4J_ADDRESS")); // Default configuration if not provided + $this->config = $config ?? new Configuration(baseUri: 'http://myaddress'); // Default configuration if not provided } /** * @api */ - public static function login(string $address, ?AuthenticateInterface $auth = null, ?Configuration $config = null): self + public static function login(string $address = null, ?AuthenticateInterface $auth = null, ?Configuration $config = null): self { $client = new Client(); $config = $config ?? new Configuration(baseUri: $address); diff --git a/tests/Integration/Neo4jQueryAPITest.php b/tests/Integration/Neo4jQueryAPITest.php index e03dcee1..e8b8b645 100644 --- a/tests/Integration/Neo4jQueryAPITest.php +++ b/tests/Integration/Neo4jQueryAPITest.php @@ -36,9 +36,23 @@ public function testLoginWithEmptyAddress() Neo4jQueryAPI::login('http://myaddress', Authentication::fromEnvironment(), $config); } - /** - * Test to ensure that an exception is thrown when baseUri is empty. - */ + public function testLoginWithNullConfiguration() + { + $config = null; + + $api = Neo4jQueryAPI::login('http://myaddress', Authentication::fromEnvironment(), $config); + + $this->assertInstanceOf(Neo4jQueryAPI::class, $api);$this->assertEquals('http://myaddress', $api->getConfig()->baseUri); + } + public function testConfigOnly() + { + $config = new COnfiguration(baseUri: 'http://valid.address'); + + $api = Neo4jQueryAPI::login(auth: Authentication::fromEnvironment(), config: $config); + + $this->assertInstanceOf(Neo4jQueryAPI::class, $api); + $this->assertEquals('http://valid.address', $api->getConfig()->baseUri); + } } From 7d3569ce02c5919bbfda87099857dac44e4fba8d Mon Sep 17 00:00:00 2001 From: Pratiksha Date: Tue, 18 Feb 2025 10:32:39 +0530 Subject: [PATCH 06/11] DEBUG --- .php-cs-fixer.cache | 2 +- src/Configuration.php | 1 - src/Neo4jQueryAPI.php | 3 +-- src/abc.php | 2 +- tests/Integration/Neo4jQueryAPITest.php | 5 ++++- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache index 444ba97f..72946c80 100644 --- a/.php-cs-fixer.cache +++ b/.php-cs-fixer.cache @@ -1 +1 @@ -{"php":"8.3.16","version":"3.68.5:v3.68.5#7bedb718b633355272428c60736dc97fb96daf27","indent":" ","lineEnding":"\n","rules":{"binary_operator_spaces":{"default":"at_least_single_space"},"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_parentheses":true,"no_blank_lines_after_class_opening":true,"no_extra_blank_lines":{"tokens":["use"]},"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_space_around_construct":{"constructs_followed_by_a_single_space":["abstract","as","case","catch","class","const_import","do","else","elseif","final","finally","for","foreach","function","function_import","if","insteadof","interface","namespace","new","private","protected","public","static","switch","trait","try","use","use_lambda","while"],"constructs_preceded_by_a_single_space":["as","else","elseif","use_lambda"]},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":{"only_dec_inc":true},"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"attribute_placement":"ignore","on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"strict_param":true},"hashes":{"tests\/resources\/expected\/complex-query-profile.php":"c0d16588e70d32588ec2e55ba5ae5873","tests\/Unit\/Neo4jExceptionUnitTest.php":"e07e604496e0e4032d2798ee9d2cb1b2","tests\/Unit\/ResultRowTest.php":"b4b307579a75da8307d6d65eb5548cae","tests\/Unit\/Neo4jQueryAPIUnitTest.php":"87e08aca0ccef5589c88bd7249e39496","tests\/Unit\/Neo4jRequestFactoryTest.php":"ebc6d5ee7790df4d69a5b555ad48ff5a","tests\/Unit\/AuthenticationTest.php":"746b185bcfb47a925e35b5b79b854fab","tests\/Integration\/Neo4jQueryAPIIntegrationTest.php":"43f34ad1774e3eeb133a9e3bb96f191d","tests\/Integration\/Neo4jTransactionIntegrationTest.php":"35fcbd5afbec5bb59f35040d9d6c518f","tests\/Integration\/Neo4jOGMTest.php":"e03f51ef605ca818763f3897d7a30830","src\/OGM.php":"211c087b78fca69390701e2f505e46fe","src\/Neo4jQueryAPI.php":"a7a505057617a2de3a94a73065254ecb","src\/BearerAuthentication.php":"51b5f02280a43838465cffa8974648c6","src\/Enums\/AccessMode.php":"88b5c70c4716cc68bcb86e2f162dd347","src\/Results\/ResultRow.php":"92dc1ec9315fa5236a79468ffaf9a60c","src\/Results\/ResultSet.php":"372faa2af185b25b804be1974c34b1ae","src\/Exception\/Neo4jException.php":"89c4c090cd3ba6e94c13eab7ebd0588c","src\/NoAuth.php":"2267e8a5b07aeaaab3165bb105b10807","src\/loginConfig.php":"47e9993051fc556a7fc28bc8f9a01caa","src\/AuthenticateInterface.php":"1da849c5d5b88439e01543d5d5b9f8d9","src\/BasicAuthentication.php":"ab50275cc6841d88d289a63d86ecb118","src\/Configuration.php":"fabfe6acf58bb0bda76453ace4f0757d","src\/ResponseParser.php":"e32270966c3a618bcb5ea9c6497748be","src\/Neo4jRequestFactory.php":"e3279d36e54032c6acf92df10ac47f07","src\/Objects\/Path.php":"e8091a19eb4e70ced4f8f7364dbe78be","src\/Objects\/Node.php":"ac679671f513c6c996dbf75a66fcacb2","src\/Objects\/Authentication.php":"f31af1c057be0f490cc2dba365f03b31","src\/Objects\/ProfiledQueryPlanArguments.php":"02b5fa2d50fec5d0fb0c4ada55ebda69","src\/Objects\/Person.php":"cee5594450a015103e12d4cbe186f167","src\/Objects\/Point.php":"4115d8d1b85a0d6e37b79d303237bcd0","src\/Objects\/ResultSet.php":"a5ba56fc6c6e250c22b183ac26dfd68e","src\/Objects\/ProfiledQueryPlan.php":"75ab6c3ad2ce97675a8e6478d17ac4d9","src\/Objects\/Bookmarks.php":"2c3e7229ce9b56c0352155b3feaac9bb","src\/Objects\/ResultCounters.php":"a9372c98fe7bede10cb004af30ea502f","src\/Objects\/Relationship.php":"e344e22d5a41f1795f3310d55ea51c20","src\/Transaction.php":"ff5454897ddbcc4fc2a984ecb90a90fd","src\/Authentication\/BearerAuthentication.php":"08a9e3c01d3833255cd51c94a17f1aa3","src\/Authentication\/NoAuth.php":"71cc7d784b9d98c62d2342faf38f7dc4","src\/Authentication\/AuthenticateInterface.php":"65b5a1074e11fba04362e754ad97023f","src\/Authentication\/BasicAuthentication.php":"c37b7ef26a59c032ac2a6a7b91c5adae"}} \ No newline at end of file +{"php":"8.3.16","version":"3.68.5:v3.68.5#7bedb718b633355272428c60736dc97fb96daf27","indent":" ","lineEnding":"\n","rules":{"binary_operator_spaces":{"default":"at_least_single_space"},"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_parentheses":true,"no_blank_lines_after_class_opening":true,"no_extra_blank_lines":{"tokens":["use"]},"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_space_around_construct":{"constructs_followed_by_a_single_space":["abstract","as","case","catch","class","const_import","do","else","elseif","final","finally","for","foreach","function","function_import","if","insteadof","interface","namespace","new","private","protected","public","static","switch","trait","try","use","use_lambda","while"],"constructs_preceded_by_a_single_space":["as","else","elseif","use_lambda"]},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":{"only_dec_inc":true},"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"attribute_placement":"ignore","on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"strict_param":true},"hashes":{"tests\/resources\/expected\/complex-query-profile.php":"c0d16588e70d32588ec2e55ba5ae5873","tests\/Unit\/Neo4jExceptionUnitTest.php":"e07e604496e0e4032d2798ee9d2cb1b2","tests\/Unit\/ResultRowTest.php":"b4b307579a75da8307d6d65eb5548cae","tests\/Unit\/Neo4jQueryAPIUnitTest.php":"87e08aca0ccef5589c88bd7249e39496","tests\/Unit\/Neo4jRequestFactoryTest.php":"ebc6d5ee7790df4d69a5b555ad48ff5a","tests\/Unit\/AuthenticationTest.php":"746b185bcfb47a925e35b5b79b854fab","tests\/Integration\/Neo4jTransactionIntegrationTest.php":"35fcbd5afbec5bb59f35040d9d6c518f","tests\/Integration\/Neo4jOGMTest.php":"e03f51ef605ca818763f3897d7a30830","src\/OGM.php":"211c087b78fca69390701e2f505e46fe","src\/BearerAuthentication.php":"51b5f02280a43838465cffa8974648c6","src\/Enums\/AccessMode.php":"88b5c70c4716cc68bcb86e2f162dd347","src\/Results\/ResultRow.php":"92dc1ec9315fa5236a79468ffaf9a60c","src\/Results\/ResultSet.php":"372faa2af185b25b804be1974c34b1ae","src\/Exception\/Neo4jException.php":"89c4c090cd3ba6e94c13eab7ebd0588c","src\/NoAuth.php":"2267e8a5b07aeaaab3165bb105b10807","src\/loginConfig.php":"47e9993051fc556a7fc28bc8f9a01caa","src\/AuthenticateInterface.php":"1da849c5d5b88439e01543d5d5b9f8d9","src\/BasicAuthentication.php":"ab50275cc6841d88d289a63d86ecb118","src\/ResponseParser.php":"e32270966c3a618bcb5ea9c6497748be","src\/Neo4jRequestFactory.php":"e3279d36e54032c6acf92df10ac47f07","src\/Objects\/Path.php":"e8091a19eb4e70ced4f8f7364dbe78be","src\/Objects\/Node.php":"ac679671f513c6c996dbf75a66fcacb2","src\/Objects\/Authentication.php":"f31af1c057be0f490cc2dba365f03b31","src\/Objects\/ProfiledQueryPlanArguments.php":"02b5fa2d50fec5d0fb0c4ada55ebda69","src\/Objects\/Person.php":"cee5594450a015103e12d4cbe186f167","src\/Objects\/Point.php":"4115d8d1b85a0d6e37b79d303237bcd0","src\/Objects\/ResultSet.php":"a5ba56fc6c6e250c22b183ac26dfd68e","src\/Objects\/ProfiledQueryPlan.php":"75ab6c3ad2ce97675a8e6478d17ac4d9","src\/Objects\/Bookmarks.php":"2c3e7229ce9b56c0352155b3feaac9bb","src\/Objects\/ResultCounters.php":"a9372c98fe7bede10cb004af30ea502f","src\/Objects\/Relationship.php":"e344e22d5a41f1795f3310d55ea51c20","src\/Transaction.php":"ff5454897ddbcc4fc2a984ecb90a90fd","src\/Authentication\/BearerAuthentication.php":"08a9e3c01d3833255cd51c94a17f1aa3","src\/Authentication\/NoAuth.php":"71cc7d784b9d98c62d2342faf38f7dc4","src\/Authentication\/AuthenticateInterface.php":"65b5a1074e11fba04362e754ad97023f","src\/Authentication\/BasicAuthentication.php":"c37b7ef26a59c032ac2a6a7b91c5adae","tests\/Integration\/Neo4jQueryAPITest.php":"efe1746a391181462d0e4dadae5e13d6","src\/abc.php":"0c2050218cf3d57c52a64df9f58b538b","tests\/Integration\/Neo4jQueryAPIIntegrationTest.php":"3dc17347951ae97e0131e0793f8f90e5","src\/Neo4jQueryAPI.php":"4b2ea15c28fa8d0f4b8b3f227d1f8235","src\/Configuration.php":"85085606c9b345cb6859e5c303896b13"}} \ No newline at end of file diff --git a/src/Configuration.php b/src/Configuration.php index d0a0b233..1ae1d603 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -31,4 +31,3 @@ public function __construct( } } } - diff --git a/src/Neo4jQueryAPI.php b/src/Neo4jQueryAPI.php index 250d544c..0d7370c2 100644 --- a/src/Neo4jQueryAPI.php +++ b/src/Neo4jQueryAPI.php @@ -35,7 +35,7 @@ public static function login(string $address = null, ?AuthenticateInterface $aut $config = $config ?? new Configuration(baseUri: $address); - /* if the user now passes a config object without an address it will break. + /* if the user now passes a config object without an address it will break. $config = new Configuration(database: 'mydb'); @@ -50,7 +50,6 @@ public static function login(string $address = null, ?AuthenticateInterface $aut auth: $auth ?? Authentication::fromEnvironment() ), config: $config - ); } diff --git a/src/abc.php b/src/abc.php index d430365a..6ff6fc87 100644 --- a/src/abc.php +++ b/src/abc.php @@ -26,7 +26,7 @@ foreach ($resultSet as $row) { $node = $row['n']; - $properties = $node->getProperties(); + $properties = $node->getProperties(); if (isset($properties['title'])) { echo "Movie Title: " . $properties['title'] . "\n"; diff --git a/tests/Integration/Neo4jQueryAPITest.php b/tests/Integration/Neo4jQueryAPITest.php index e8b8b645..fa487fde 100644 --- a/tests/Integration/Neo4jQueryAPITest.php +++ b/tests/Integration/Neo4jQueryAPITest.php @@ -1,4 +1,5 @@ assertInstanceOf(Neo4jQueryAPI::class, $api);$this->assertEquals('http://myaddress', $api->getConfig()->baseUri); + $this->assertInstanceOf(Neo4jQueryAPI::class, $api); + $this->assertEquals('http://myaddress', $api->getConfig()->baseUri); } public function testConfigOnly() { From e433d32aa2befcf9dfe75828a4517f8d855ef3e1 Mon Sep 17 00:00:00 2001 From: Pratiksha Date: Tue, 18 Feb 2025 10:42:31 +0530 Subject: [PATCH 07/11] DEBUG --- .php-cs-fixer.cache | 2 +- tests/Integration/Neo4jQueryAPITest.php | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache index 72946c80..a28b8290 100644 --- a/.php-cs-fixer.cache +++ b/.php-cs-fixer.cache @@ -1 +1 @@ -{"php":"8.3.16","version":"3.68.5:v3.68.5#7bedb718b633355272428c60736dc97fb96daf27","indent":" ","lineEnding":"\n","rules":{"binary_operator_spaces":{"default":"at_least_single_space"},"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_parentheses":true,"no_blank_lines_after_class_opening":true,"no_extra_blank_lines":{"tokens":["use"]},"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_space_around_construct":{"constructs_followed_by_a_single_space":["abstract","as","case","catch","class","const_import","do","else","elseif","final","finally","for","foreach","function","function_import","if","insteadof","interface","namespace","new","private","protected","public","static","switch","trait","try","use","use_lambda","while"],"constructs_preceded_by_a_single_space":["as","else","elseif","use_lambda"]},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":{"only_dec_inc":true},"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"attribute_placement":"ignore","on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"strict_param":true},"hashes":{"tests\/resources\/expected\/complex-query-profile.php":"c0d16588e70d32588ec2e55ba5ae5873","tests\/Unit\/Neo4jExceptionUnitTest.php":"e07e604496e0e4032d2798ee9d2cb1b2","tests\/Unit\/ResultRowTest.php":"b4b307579a75da8307d6d65eb5548cae","tests\/Unit\/Neo4jQueryAPIUnitTest.php":"87e08aca0ccef5589c88bd7249e39496","tests\/Unit\/Neo4jRequestFactoryTest.php":"ebc6d5ee7790df4d69a5b555ad48ff5a","tests\/Unit\/AuthenticationTest.php":"746b185bcfb47a925e35b5b79b854fab","tests\/Integration\/Neo4jTransactionIntegrationTest.php":"35fcbd5afbec5bb59f35040d9d6c518f","tests\/Integration\/Neo4jOGMTest.php":"e03f51ef605ca818763f3897d7a30830","src\/OGM.php":"211c087b78fca69390701e2f505e46fe","src\/BearerAuthentication.php":"51b5f02280a43838465cffa8974648c6","src\/Enums\/AccessMode.php":"88b5c70c4716cc68bcb86e2f162dd347","src\/Results\/ResultRow.php":"92dc1ec9315fa5236a79468ffaf9a60c","src\/Results\/ResultSet.php":"372faa2af185b25b804be1974c34b1ae","src\/Exception\/Neo4jException.php":"89c4c090cd3ba6e94c13eab7ebd0588c","src\/NoAuth.php":"2267e8a5b07aeaaab3165bb105b10807","src\/loginConfig.php":"47e9993051fc556a7fc28bc8f9a01caa","src\/AuthenticateInterface.php":"1da849c5d5b88439e01543d5d5b9f8d9","src\/BasicAuthentication.php":"ab50275cc6841d88d289a63d86ecb118","src\/ResponseParser.php":"e32270966c3a618bcb5ea9c6497748be","src\/Neo4jRequestFactory.php":"e3279d36e54032c6acf92df10ac47f07","src\/Objects\/Path.php":"e8091a19eb4e70ced4f8f7364dbe78be","src\/Objects\/Node.php":"ac679671f513c6c996dbf75a66fcacb2","src\/Objects\/Authentication.php":"f31af1c057be0f490cc2dba365f03b31","src\/Objects\/ProfiledQueryPlanArguments.php":"02b5fa2d50fec5d0fb0c4ada55ebda69","src\/Objects\/Person.php":"cee5594450a015103e12d4cbe186f167","src\/Objects\/Point.php":"4115d8d1b85a0d6e37b79d303237bcd0","src\/Objects\/ResultSet.php":"a5ba56fc6c6e250c22b183ac26dfd68e","src\/Objects\/ProfiledQueryPlan.php":"75ab6c3ad2ce97675a8e6478d17ac4d9","src\/Objects\/Bookmarks.php":"2c3e7229ce9b56c0352155b3feaac9bb","src\/Objects\/ResultCounters.php":"a9372c98fe7bede10cb004af30ea502f","src\/Objects\/Relationship.php":"e344e22d5a41f1795f3310d55ea51c20","src\/Transaction.php":"ff5454897ddbcc4fc2a984ecb90a90fd","src\/Authentication\/BearerAuthentication.php":"08a9e3c01d3833255cd51c94a17f1aa3","src\/Authentication\/NoAuth.php":"71cc7d784b9d98c62d2342faf38f7dc4","src\/Authentication\/AuthenticateInterface.php":"65b5a1074e11fba04362e754ad97023f","src\/Authentication\/BasicAuthentication.php":"c37b7ef26a59c032ac2a6a7b91c5adae","tests\/Integration\/Neo4jQueryAPITest.php":"efe1746a391181462d0e4dadae5e13d6","src\/abc.php":"0c2050218cf3d57c52a64df9f58b538b","tests\/Integration\/Neo4jQueryAPIIntegrationTest.php":"3dc17347951ae97e0131e0793f8f90e5","src\/Neo4jQueryAPI.php":"4b2ea15c28fa8d0f4b8b3f227d1f8235","src\/Configuration.php":"85085606c9b345cb6859e5c303896b13"}} \ No newline at end of file +{"php":"8.3.16","version":"3.68.5:v3.68.5#7bedb718b633355272428c60736dc97fb96daf27","indent":" ","lineEnding":"\n","rules":{"binary_operator_spaces":{"default":"at_least_single_space"},"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_parentheses":true,"no_blank_lines_after_class_opening":true,"no_extra_blank_lines":{"tokens":["use"]},"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_space_around_construct":{"constructs_followed_by_a_single_space":["abstract","as","case","catch","class","const_import","do","else","elseif","final","finally","for","foreach","function","function_import","if","insteadof","interface","namespace","new","private","protected","public","static","switch","trait","try","use","use_lambda","while"],"constructs_preceded_by_a_single_space":["as","else","elseif","use_lambda"]},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":{"only_dec_inc":true},"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"attribute_placement":"ignore","on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"strict_param":true},"hashes":{"tests\/resources\/expected\/complex-query-profile.php":"c0d16588e70d32588ec2e55ba5ae5873","tests\/Unit\/Neo4jExceptionUnitTest.php":"e07e604496e0e4032d2798ee9d2cb1b2","tests\/Unit\/ResultRowTest.php":"b4b307579a75da8307d6d65eb5548cae","tests\/Unit\/Neo4jQueryAPIUnitTest.php":"87e08aca0ccef5589c88bd7249e39496","tests\/Unit\/Neo4jRequestFactoryTest.php":"ebc6d5ee7790df4d69a5b555ad48ff5a","tests\/Unit\/AuthenticationTest.php":"746b185bcfb47a925e35b5b79b854fab","tests\/Integration\/Neo4jTransactionIntegrationTest.php":"35fcbd5afbec5bb59f35040d9d6c518f","tests\/Integration\/Neo4jOGMTest.php":"e03f51ef605ca818763f3897d7a30830","src\/OGM.php":"211c087b78fca69390701e2f505e46fe","src\/BearerAuthentication.php":"51b5f02280a43838465cffa8974648c6","src\/Enums\/AccessMode.php":"88b5c70c4716cc68bcb86e2f162dd347","src\/Results\/ResultRow.php":"92dc1ec9315fa5236a79468ffaf9a60c","src\/Results\/ResultSet.php":"372faa2af185b25b804be1974c34b1ae","src\/Exception\/Neo4jException.php":"89c4c090cd3ba6e94c13eab7ebd0588c","src\/NoAuth.php":"2267e8a5b07aeaaab3165bb105b10807","src\/loginConfig.php":"47e9993051fc556a7fc28bc8f9a01caa","src\/AuthenticateInterface.php":"1da849c5d5b88439e01543d5d5b9f8d9","src\/BasicAuthentication.php":"ab50275cc6841d88d289a63d86ecb118","src\/ResponseParser.php":"e32270966c3a618bcb5ea9c6497748be","src\/Neo4jRequestFactory.php":"e3279d36e54032c6acf92df10ac47f07","src\/Objects\/Path.php":"e8091a19eb4e70ced4f8f7364dbe78be","src\/Objects\/Node.php":"ac679671f513c6c996dbf75a66fcacb2","src\/Objects\/Authentication.php":"f31af1c057be0f490cc2dba365f03b31","src\/Objects\/ProfiledQueryPlanArguments.php":"02b5fa2d50fec5d0fb0c4ada55ebda69","src\/Objects\/Person.php":"cee5594450a015103e12d4cbe186f167","src\/Objects\/Point.php":"4115d8d1b85a0d6e37b79d303237bcd0","src\/Objects\/ResultSet.php":"a5ba56fc6c6e250c22b183ac26dfd68e","src\/Objects\/ProfiledQueryPlan.php":"75ab6c3ad2ce97675a8e6478d17ac4d9","src\/Objects\/Bookmarks.php":"2c3e7229ce9b56c0352155b3feaac9bb","src\/Objects\/ResultCounters.php":"a9372c98fe7bede10cb004af30ea502f","src\/Objects\/Relationship.php":"e344e22d5a41f1795f3310d55ea51c20","src\/Transaction.php":"ff5454897ddbcc4fc2a984ecb90a90fd","src\/Authentication\/BearerAuthentication.php":"08a9e3c01d3833255cd51c94a17f1aa3","src\/Authentication\/NoAuth.php":"71cc7d784b9d98c62d2342faf38f7dc4","src\/Authentication\/AuthenticateInterface.php":"65b5a1074e11fba04362e754ad97023f","src\/Authentication\/BasicAuthentication.php":"c37b7ef26a59c032ac2a6a7b91c5adae","src\/abc.php":"0c2050218cf3d57c52a64df9f58b538b","tests\/Integration\/Neo4jQueryAPIIntegrationTest.php":"3dc17347951ae97e0131e0793f8f90e5","src\/Neo4jQueryAPI.php":"4b2ea15c28fa8d0f4b8b3f227d1f8235","src\/Configuration.php":"85085606c9b345cb6859e5c303896b13","tests\/Integration\/Neo4jQueryAPITest.php":"ace497bc6d4dff0b142ef82a2b57c198"}} \ No newline at end of file diff --git a/tests/Integration/Neo4jQueryAPITest.php b/tests/Integration/Neo4jQueryAPITest.php index fa487fde..cf306d23 100644 --- a/tests/Integration/Neo4jQueryAPITest.php +++ b/tests/Integration/Neo4jQueryAPITest.php @@ -8,7 +8,7 @@ use Neo4j\QueryAPI\Objects\Authentication; use Neo4j\QueryAPI\Configuration; - +/** @psalm-suppress UnusedClass */ class Neo4jQueryAPITest extends TestCase { public function testLoginWithConfigurationWithoutAddress() @@ -27,8 +27,9 @@ public function testLoginWithValidConfiguration() $api = Neo4jQueryAPI::login('http://myaddress', Authentication::fromEnvironment(), $config); $this->assertInstanceOf(Neo4jQueryAPI::class, $api); - $this->assertEquals('http://valid.address', $config->baseUri); + $this->assertEquals('http://valid.address', $api->getConfig()->baseUri); } + public function testLoginWithEmptyAddress() { $this->expectException(InvalidArgumentException::class); @@ -38,6 +39,7 @@ public function testLoginWithEmptyAddress() Neo4jQueryAPI::login('http://myaddress', Authentication::fromEnvironment(), $config); } + public function testLoginWithNullConfiguration() { $config = null; @@ -47,15 +49,14 @@ public function testLoginWithNullConfiguration() $this->assertInstanceOf(Neo4jQueryAPI::class, $api); $this->assertEquals('http://myaddress', $api->getConfig()->baseUri); } + public function testConfigOnly() { - $config = new COnfiguration(baseUri: 'http://valid.address'); + $config = new Configuration(baseUri: 'http://valid.address'); $api = Neo4jQueryAPI::login(auth: Authentication::fromEnvironment(), config: $config); $this->assertInstanceOf(Neo4jQueryAPI::class, $api); $this->assertEquals('http://valid.address', $api->getConfig()->baseUri); } - - } From 35e3849638120f172499ae6b0a6d4c2010452e1b Mon Sep 17 00:00:00 2001 From: Pratiksha Date: Tue, 18 Feb 2025 10:46:06 +0530 Subject: [PATCH 08/11] Removed .php-cs-fixer.cache from repository --- .php-cs-fixer.cache | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .php-cs-fixer.cache diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache deleted file mode 100644 index a28b8290..00000000 --- a/.php-cs-fixer.cache +++ /dev/null @@ -1 +0,0 @@ -{"php":"8.3.16","version":"3.68.5:v3.68.5#7bedb718b633355272428c60736dc97fb96daf27","indent":" ","lineEnding":"\n","rules":{"binary_operator_spaces":{"default":"at_least_single_space"},"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_parentheses":true,"no_blank_lines_after_class_opening":true,"no_extra_blank_lines":{"tokens":["use"]},"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_space_around_construct":{"constructs_followed_by_a_single_space":["abstract","as","case","catch","class","const_import","do","else","elseif","final","finally","for","foreach","function","function_import","if","insteadof","interface","namespace","new","private","protected","public","static","switch","trait","try","use","use_lambda","while"],"constructs_preceded_by_a_single_space":["as","else","elseif","use_lambda"]},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":{"only_dec_inc":true},"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"attribute_placement":"ignore","on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"strict_param":true},"hashes":{"tests\/resources\/expected\/complex-query-profile.php":"c0d16588e70d32588ec2e55ba5ae5873","tests\/Unit\/Neo4jExceptionUnitTest.php":"e07e604496e0e4032d2798ee9d2cb1b2","tests\/Unit\/ResultRowTest.php":"b4b307579a75da8307d6d65eb5548cae","tests\/Unit\/Neo4jQueryAPIUnitTest.php":"87e08aca0ccef5589c88bd7249e39496","tests\/Unit\/Neo4jRequestFactoryTest.php":"ebc6d5ee7790df4d69a5b555ad48ff5a","tests\/Unit\/AuthenticationTest.php":"746b185bcfb47a925e35b5b79b854fab","tests\/Integration\/Neo4jTransactionIntegrationTest.php":"35fcbd5afbec5bb59f35040d9d6c518f","tests\/Integration\/Neo4jOGMTest.php":"e03f51ef605ca818763f3897d7a30830","src\/OGM.php":"211c087b78fca69390701e2f505e46fe","src\/BearerAuthentication.php":"51b5f02280a43838465cffa8974648c6","src\/Enums\/AccessMode.php":"88b5c70c4716cc68bcb86e2f162dd347","src\/Results\/ResultRow.php":"92dc1ec9315fa5236a79468ffaf9a60c","src\/Results\/ResultSet.php":"372faa2af185b25b804be1974c34b1ae","src\/Exception\/Neo4jException.php":"89c4c090cd3ba6e94c13eab7ebd0588c","src\/NoAuth.php":"2267e8a5b07aeaaab3165bb105b10807","src\/loginConfig.php":"47e9993051fc556a7fc28bc8f9a01caa","src\/AuthenticateInterface.php":"1da849c5d5b88439e01543d5d5b9f8d9","src\/BasicAuthentication.php":"ab50275cc6841d88d289a63d86ecb118","src\/ResponseParser.php":"e32270966c3a618bcb5ea9c6497748be","src\/Neo4jRequestFactory.php":"e3279d36e54032c6acf92df10ac47f07","src\/Objects\/Path.php":"e8091a19eb4e70ced4f8f7364dbe78be","src\/Objects\/Node.php":"ac679671f513c6c996dbf75a66fcacb2","src\/Objects\/Authentication.php":"f31af1c057be0f490cc2dba365f03b31","src\/Objects\/ProfiledQueryPlanArguments.php":"02b5fa2d50fec5d0fb0c4ada55ebda69","src\/Objects\/Person.php":"cee5594450a015103e12d4cbe186f167","src\/Objects\/Point.php":"4115d8d1b85a0d6e37b79d303237bcd0","src\/Objects\/ResultSet.php":"a5ba56fc6c6e250c22b183ac26dfd68e","src\/Objects\/ProfiledQueryPlan.php":"75ab6c3ad2ce97675a8e6478d17ac4d9","src\/Objects\/Bookmarks.php":"2c3e7229ce9b56c0352155b3feaac9bb","src\/Objects\/ResultCounters.php":"a9372c98fe7bede10cb004af30ea502f","src\/Objects\/Relationship.php":"e344e22d5a41f1795f3310d55ea51c20","src\/Transaction.php":"ff5454897ddbcc4fc2a984ecb90a90fd","src\/Authentication\/BearerAuthentication.php":"08a9e3c01d3833255cd51c94a17f1aa3","src\/Authentication\/NoAuth.php":"71cc7d784b9d98c62d2342faf38f7dc4","src\/Authentication\/AuthenticateInterface.php":"65b5a1074e11fba04362e754ad97023f","src\/Authentication\/BasicAuthentication.php":"c37b7ef26a59c032ac2a6a7b91c5adae","src\/abc.php":"0c2050218cf3d57c52a64df9f58b538b","tests\/Integration\/Neo4jQueryAPIIntegrationTest.php":"3dc17347951ae97e0131e0793f8f90e5","src\/Neo4jQueryAPI.php":"4b2ea15c28fa8d0f4b8b3f227d1f8235","src\/Configuration.php":"85085606c9b345cb6859e5c303896b13","tests\/Integration\/Neo4jQueryAPITest.php":"ace497bc6d4dff0b142ef82a2b57c198"}} \ No newline at end of file From ddf648c55b2d195ce2cbdfa76ec5636fb507ebbe Mon Sep 17 00:00:00 2001 From: Pratiksha Date: Tue, 18 Feb 2025 11:36:46 +0530 Subject: [PATCH 09/11] Debug --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index 45aca26b..3b39edc1 100644 --- a/.gitignore +++ b/.gitignore @@ -13,5 +13,3 @@ test #PHP-CS-FIXER .php-cs-fixer.php .php-cs-fixer.cache - - From bbe5763064f7341dfeb8b0cc9254c28057c0de88 Mon Sep 17 00:00:00 2001 From: Pratiksha Date: Thu, 20 Feb 2025 16:53:17 +0530 Subject: [PATCH 10/11] DEBUG --- src/Configuration.php | 4 +-- src/abc.php | 42 ------------------------- tests/Integration/Neo4jQueryAPITest.php | 18 ----------- 3 files changed, 1 insertion(+), 63 deletions(-) delete mode 100644 src/abc.php diff --git a/src/Configuration.php b/src/Configuration.php index 1ae1d603..c88f87ef 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -26,8 +26,6 @@ public function __construct( public readonly Bookmarks $bookmarks = new Bookmarks([]), public readonly AccessMode $accessMode = AccessMode::WRITE, ) { - if (empty($this->baseUri)) { - throw new InvalidArgumentException("Address (baseUri) must be provided."); - } + } } diff --git a/src/abc.php b/src/abc.php deleted file mode 100644 index 6ff6fc87..00000000 --- a/src/abc.php +++ /dev/null @@ -1,42 +0,0 @@ -run($cypher); - -foreach ($resultSet as $row) { - $node = $row['n']; - - $properties = $node->getProperties(); - - if (isset($properties['title'])) { - echo "Movie Title: " . $properties['title'] . "\n"; - } else { - echo "Title not found.\n"; - } - - if (isset($properties['released'])) { - echo "Movie Year: " . $properties['released'] . "\n"; - } else { - echo "Year not found.\n"; - } -} diff --git a/tests/Integration/Neo4jQueryAPITest.php b/tests/Integration/Neo4jQueryAPITest.php index cf306d23..704c3f1c 100644 --- a/tests/Integration/Neo4jQueryAPITest.php +++ b/tests/Integration/Neo4jQueryAPITest.php @@ -11,14 +11,6 @@ /** @psalm-suppress UnusedClass */ class Neo4jQueryAPITest extends TestCase { - public function testLoginWithConfigurationWithoutAddress() - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Address (baseUri) must be provided."); - $config = new Configuration(baseUri: ""); - - Neo4jQueryAPI::login('http://myaddress', Authentication::fromEnvironment(), $config); - } public function testLoginWithValidConfiguration() { @@ -30,16 +22,6 @@ public function testLoginWithValidConfiguration() $this->assertEquals('http://valid.address', $api->getConfig()->baseUri); } - public function testLoginWithEmptyAddress() - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Address (baseUri) must be provided."); - - $config = new Configuration(baseUri: ""); - - Neo4jQueryAPI::login('http://myaddress', Authentication::fromEnvironment(), $config); - } - public function testLoginWithNullConfiguration() { $config = null; From 6378f6c4041dd79ec231b06573650613408102a5 Mon Sep 17 00:00:00 2001 From: Pratiksha Date: Thu, 20 Feb 2025 16:56:01 +0530 Subject: [PATCH 11/11] DEBUG --- tests/Integration/Neo4jQueryAPITest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Integration/Neo4jQueryAPITest.php b/tests/Integration/Neo4jQueryAPITest.php index 704c3f1c..1816df55 100644 --- a/tests/Integration/Neo4jQueryAPITest.php +++ b/tests/Integration/Neo4jQueryAPITest.php @@ -11,7 +11,6 @@ /** @psalm-suppress UnusedClass */ class Neo4jQueryAPITest extends TestCase { - public function testLoginWithValidConfiguration() { $config = new Configuration(baseUri: 'http://valid.address');