init() public static méthode

Initiate an instance of this class if one doesn't exist already. Return the WPCOM_VIP_Jetpack_Mandatory instance.
public static init ( ) : WPCOM_VIP_Jetpack_Mandatory
Résultat WPCOM_VIP_Jetpack_Mandatory object The instance of WPCOM_VIP_Jetpack_Mandatory
 function test_default_modules_include_mandatory_modules()
 {
     // Arrange
     $jpm = WPCOM_VIP_Jetpack_Mandatory::init();
     // Act
     $default_modules = Jetpack::get_default_modules();
     // Assert
     foreach ($jpm->get_mandatory_modules() as $mandatory_module) {
         $this->assertTrue(in_array($mandatory_module, $default_modules));
     }
 }
					</td>
				</tr>
				<# }); } else { #>
					<tr class="no-modules-found">
						<td colspan="2"><?php 
        esc_html_e('No Modules Found', 'jetpack');
        ?>
</td>
					</tr>
				<# } #>
		</script>
		<?php 
    }
    /**
     * Takes an array of module slugs and adds our mandatory modules
     * if they are not already present.
     *
     * @param array $modules An array of Jetpack module slugs
     *
     * @return array An array of Jetpack module slugs
     */
    public function add_mandatory_modules($modules)
    {
        $modules = array_merge($modules, $this->mandatory_modules);
        $modules = array_unique($modules);
        $modules = array_values($modules);
        return $modules;
    }
}
WPCOM_VIP_Jetpack_Mandatory::init();