88use NeuronAI \Tests \Stubs \StructuredOutput \Color ;
99use NeuronAI \Tests \Stubs \Tools \TestToolClassOnlyParentConstructor ;
1010use NeuronAI \Tests \Stubs \Tools \TestToolClassOnlyParentConstructorFluent ;
11- use NeuronAI \Tests \Stubs \Tools \TestToolClassWithoutParentConstructor ;
12- use NeuronAI \Tests \Stubs \Tools \TestToolClassWithoutParentConstructorMixed ;
1311use NeuronAI \Tests \Stubs \Tools \TestToolClassWithParentConstructor ;
1412use NeuronAI \Tests \Stubs \Tools \TestToolClassWithParentConstructorMixed ;
1513use NeuronAI \Tools \ArrayProperty ;
2119use PHPUnit \Framework \TestCase ;
2220use Error ;
2321
24- use function count ;
25-
2622class ToolTest extends TestCase
2723{
2824 public function test_tool_instance (): void
@@ -415,28 +411,10 @@ public function test_tool_named_parameters(): void
415411 );
416412 }
417413
418- public function test_properties_declaration_on_method_and_constructor_without_parent_constructor (): void
419- {
420- $ tool = new TestToolClassWithoutParentConstructorMixed ('test ' );
421- $ this ->assertEquals (1 , count ($ tool ->getProperties ()));
422- $ this ->assertEquals ('test_tool ' , $ tool ->getName ());
423- $ this ->assertEquals ('test tool ' , $ tool ->getDescription ());
424- $ this ->assertEquals ('test ' , $ tool ->getKey ());
425- }
426-
427- public function test_properties_declaration_on_method_without_parent_constructor (): void
428- {
429- $ tool = new TestToolClassWithoutParentConstructor ('test ' );
430- $ this ->assertEquals (2 , count ($ tool ->getProperties ()));
431- $ this ->assertEquals ('test_tool ' , $ tool ->getName ());
432- $ this ->assertEquals ('test tool ' , $ tool ->getDescription ());
433- $ this ->assertEquals ('test ' , $ tool ->getKey ());
434- }
435-
436414 public function test_properties_declaration_on_method_and_constructor_with_parent_constructor (): void
437415 {
438416 $ tool = new TestToolClassWithParentConstructorMixed ('test ' );
439- $ this ->assertEquals (1 , count ( $ tool ->getProperties () ));
417+ $ this ->assertCount (1 , $ tool ->getProperties ());
440418 $ this ->assertEquals ('test_tool ' , $ tool ->getName ());
441419 $ this ->assertEquals ('test tool ' , $ tool ->getDescription ());
442420 $ this ->assertEquals ('test ' , $ tool ->getKey ());
@@ -445,7 +423,7 @@ public function test_properties_declaration_on_method_and_constructor_with_paren
445423 public function test_properties_declaration_on_method_with_parent_constructor (): void
446424 {
447425 $ tool = new TestToolClassWithParentConstructor ('test ' );
448- $ this ->assertEquals (1 , count ( $ tool ->getProperties () ));
426+ $ this ->assertCount (1 , $ tool ->getProperties ());
449427 $ this ->assertEquals ('test_tool ' , $ tool ->getName ());
450428 $ this ->assertEquals ('test tool ' , $ tool ->getDescription ());
451429 $ this ->assertEquals ('test ' , $ tool ->getKey ());
@@ -454,7 +432,7 @@ public function test_properties_declaration_on_method_with_parent_constructor():
454432 public function test_properties_declaration_on_constructor_with_parent_constructor (): void
455433 {
456434 $ tool = new TestToolClassOnlyParentConstructor ('test ' );
457- $ this ->assertEquals (2 , count ( $ tool ->getProperties () ));
435+ $ this ->assertCount (2 , $ tool ->getProperties ());
458436 $ this ->assertEquals ('test_tool ' , $ tool ->getName ());
459437 $ this ->assertEquals ('test tool ' , $ tool ->getDescription ());
460438 $ this ->assertEquals ('test ' , $ tool ->getKey ());
@@ -463,7 +441,7 @@ public function test_properties_declaration_on_constructor_with_parent_construct
463441 public function test_properties_declaration_on_constructor_with_parent_constructor_fluent (): void
464442 {
465443 $ tool = new TestToolClassOnlyParentConstructorFluent ('test ' );
466- $ this ->assertEquals (2 , count ( $ tool ->getProperties () ));
444+ $ this ->assertCount (2 , $ tool ->getProperties ());
467445 $ this ->assertEquals ('test_tool ' , $ tool ->getName ());
468446 $ this ->assertEquals ('test tool ' , $ tool ->getDescription ());
469447 $ this ->assertEquals ('test ' , $ tool ->getKey ());
@@ -493,6 +471,9 @@ public function test_parameters(): void
493471 parameters: ['foo ' => 'bar ' ],
494472 );
495473 $ this ->assertEquals (['foo ' => 'bar ' ], $ tool ->getParameters ());
474+
475+ $ tool ->setParameters (['foo ' => 'baz ' ]);
476+ $ this ->assertEquals (['foo ' => 'baz ' ], $ tool ->getParameters ());
496477 }
497478
498479 public function test_callback_precedence (): void
0 commit comments