99use Soap \Engine \Metadata \Collection \MethodCollection ;
1010use Soap \Engine \Metadata \Collection \ParameterCollection ;
1111use Soap \Engine \Metadata \Model \Method ;
12+ use Soap \Engine \Metadata \Model \MethodMeta ;
1213use Soap \Engine \Metadata \Model \XsdType ;
1314
1415final class MethodCollectionTest extends TestCase
@@ -18,11 +19,12 @@ final class MethodCollectionTest extends TestCase
1819 protected function setUp (): void
1920 {
2021 $ this ->collection = new MethodCollection (
21- new Method ('hello ' , new ParameterCollection (), XsdType::create ('Response ' ))
22+ (new Method ('hello ' , new ParameterCollection (), XsdType::create ('Response ' )))->withMeta (
23+ static fn (MethodMeta $ meta ) => $ meta ->withAction ('uri:hello ' )
24+ )
2225 );
2326 }
2427
25-
2628 public function test_it_can_iterate_over_methods (): void
2729 {
2830 static ::assertCount (1 , $ this ->collection );
@@ -42,4 +44,16 @@ public function test_it_can_fail_fetching_by_name(): void
4244 $ this ->expectException (MetadataException::class);
4345 $ this ->collection ->fetchByName ('nope ' );
4446 }
47+
48+ public function test_it_can_fetch_by_soap_action (): void
49+ {
50+ $ method = $ this ->collection ->fetchBySoapAction ('uri:hello ' );
51+ static ::assertSame ('hello ' , $ method ->getName ());
52+ }
53+
54+ public function test_it_can_fail_fetching_by_soap_action (): void
55+ {
56+ $ this ->expectException (MetadataException::class);
57+ $ this ->collection ->fetchBySoapAction ('uri:nope ' );
58+ }
4559}
0 commit comments