File tree Expand file tree Collapse file tree 3 files changed +40
-3
lines changed
src/general/user-interface
Unit/General/User_Interface/Opt_In_Route
WP/General/User_Interface Expand file tree Collapse file tree 3 files changed +40
-3
lines changed Original file line number Diff line number Diff line change 44
55use WP_REST_Request ;
66use WP_REST_Response ;
7- use Yoast \WP \SEO \Conditionals \No_Conditionals ;
7+ use Yoast \WP \SEO \Conditionals \Yoast_Admin_And_Dashboard_Conditional ;
88use Yoast \WP \SEO \Helpers \Capability_Helper ;
99use Yoast \WP \SEO \Helpers \User_Helper ;
1010use Yoast \WP \SEO \Main ;
1515 */
1616class Opt_In_Route implements Route_Interface {
1717
18- use No_Conditionals;
19-
2018 /**
2119 * The namespace for this route.
2220 *
@@ -45,6 +43,17 @@ class Opt_In_Route implements Route_Interface {
4543 */
4644 private $ capability_helper ;
4745
46+ /**
47+ * Returns the conditionals based on which this integration should be active.
48+ *
49+ * @return array<Yoast_Admin_And_Dashboard_Conditional> The array of conditionals.
50+ */
51+ public static function get_conditionals () {
52+ return [
53+ Yoast_Admin_And_Dashboard_Conditional::class,
54+ ];
55+ }
56+
4857 /**
4958 * Constructs Opt_In_Route.
5059 *
Original file line number Diff line number Diff line change 1+ <?php
2+ // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3+ // phpcs:disable Yoast.NamingConventions.NamespaceName.MaxExceeded
4+ namespace Yoast \WP \SEO \Tests \Unit \General \User_Interface \Opt_In_Route ;
5+
6+ use Yoast \WP \SEO \Conditionals \Yoast_Admin_And_Dashboard_Conditional ;
7+
8+ /**
9+ * Tests the Opt_In_Route get_conditionals method.
10+ *
11+ * @group opt-in-route
12+ *
13+ * @covers \Yoast\WP\SEO\General\User_Interface\Opt_In_Route::get_conditionals
14+ */
15+ final class Get_Conditional_Test extends Abstract_Opt_In_Route_Test {
16+
17+ /**
18+ * Tests the get_conditionals method.
19+ *
20+ * @return void
21+ */
22+ public function test_get_conditionals () {
23+ $ this ->assertEquals (
24+ [ Yoast_Admin_And_Dashboard_Conditional::class ],
25+ $ this ->instance ::get_conditionals ()
26+ );
27+ }
28+ }
File renamed without changes.
You can’t perform that action at this time.
0 commit comments