File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77use CurlHandle ;
88use DOMDocument ;
9+ use PHPUnit \Framework \Attributes \DataProvider ;
910use PHPUnit \Framework \TestCase ;
1011use SimpleSAML \Configuration ;
1112use SimpleSAML \TestUtils \BuiltInServer ;
@@ -162,10 +163,10 @@ public function testWrongServiceUrl(): void
162163
163164 /**
164165 * Test a valid service URL
165- * @dataProvider validServiceUrlProvider
166166 * @param string $serviceParam The name of the query parameter to use for the service url
167167 * @param string $ticketParam The name of the query parameter that will contain the ticket
168168 */
169+ #[DataProvider('validServiceUrlProvider ' )]
169170 public function testValidServiceUrl (string $ serviceParam , string $ ticketParam ): void
170171 {
171172 $ service_url = 'http://host1.domain:1234/path1 ' ;
Original file line number Diff line number Diff line change 1111
1212namespace SimpleSAML \Casserver ;
1313
14+ use PHPUnit \Framework \Attributes \DataProvider ;
1415use PHPUnit \Framework \TestCase ;
1516
1617require_once dirname (__DIR__ , 2 ) . '/public/utility/urlUtils.php ' ;
@@ -20,8 +21,8 @@ class UtilsTest extends TestCase
2021 /**
2122 * @param string $service the service url to check
2223 * @param bool $allowed is the service url allowed?
23- * @dataProvider checkServiceURLProvider
2424 */
25+ #[DataProvider('checkServiceURLProvider ' )]
2526 public function testCheckServiceURL (string $ service , bool $ allowed ): void
2627 {
2728 $ legalServices = [
Original file line number Diff line number Diff line change 44
55namespace SimpleSAML \Casserver ;
66
7+ use PHPUnit \Framework \Attributes \DataProvider ;
78use PHPUnit \Framework \TestCase ;
89use SimpleSAML \Configuration ;
910use SimpleSAML \Module \casserver \Cas \ServiceValidator ;
@@ -21,8 +22,8 @@ class ServiceValidatorTest extends TestCase
2122 *
2223 * @param string $service The service url to test
2324 * @param array $expectedConfig The expected CAS configuration to use
24- * @dataProvider overridingDataProvider
2525 */
26+ #[DataProvider('overridingDataProvider ' )]
2627 public function testOverridingServiceConfig (string $ service , array $ expectedConfig ): void
2728 {
2829 $ casConfig = [
@@ -136,8 +137,8 @@ public function overridingDataProvider(): array
136137 * Test confirming service url matching and per service configuration
137138 * @param string $service the service url to check
138139 * @param bool $allowed is the service url allowed?
139- * @dataProvider checkServiceURLProvider
140140 */
141+ #[DataProvider('checkServiceURLProvider ' )]
141142 public function testCheckServiceURL (string $ service , bool $ allowed ): void
142143 {
143144 $ casConfig = [
Original file line number Diff line number Diff line change 44
55namespace SimpleSAML \Casserver ;
66
7+ use PHPUnit \Framework \Attributes \DataProvider ;
78use PHPUnit \Framework \TestCase ;
89use SimpleSAML \Configuration ;
910use SimpleSAML \Module \casserver \Cas \CasException ;
@@ -125,10 +126,10 @@ public function testExpiredTicket(): void
125126 }
126127
127128 /**
128- * @dataProvider urlSanitizationProvider
129129 * @param string $serviceUrl The service url that will get sanitized
130130 * @param string $expectedSanitzedUrl The expected result
131131 */
132+ #[DataProvider('urlSanitizationProvider ' )]
132133 public function testUrlSanitization (string $ serviceUrl , string $ expectedSanitzedUrl ): void
133134 {
134135 $ this ->assertEquals ($ expectedSanitzedUrl , TicketValidator::sanitize ($ serviceUrl ));
@@ -159,6 +160,7 @@ public function urlSanitizationProvider(): array
159160
160161 /**
161162 * Create a ticket to use for testing
163+ *
162164 * @param string $serviceUrl The service url for this ticket
163165 * @param int $expiration seconds from now that ticket should expire
164166 * @return array the ticket contents
You can’t perform that action at this time.
0 commit comments