mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 05:18:52 +00:00
[ticket/13733] Properly test setting validate_classes to false/true
PHPBB3-13733
This commit is contained in:
parent
e954b0b82b
commit
0defce65c8
3 changed files with 76 additions and 2 deletions
7
tests/extension/ext/vendor2/bar/migrations/bar.php
Normal file
7
tests/extension/ext/vendor2/bar/migrations/bar.php
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace vendor2\foo\migrations;
|
||||
|
||||
class bar
|
||||
{
|
||||
}
|
54
tests/extension/ext/vendor2/bar/migrations/foo.php
Normal file
54
tests/extension/ext/vendor2/bar/migrations/foo.php
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
namespace vendor2\foo\migrations;
|
||||
|
||||
class foo implements \phpbb\db\migration\migration_interface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
static public function depends_on()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function effectively_installed()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function update_schema()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function revert_schema()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function update_data()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function revert_data()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
|
@ -11,6 +11,9 @@
|
|||
*
|
||||
*/
|
||||
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
|
||||
require_once dirname(__FILE__) . '/ext/vendor2/bar/migrations/bar.php';
|
||||
require_once dirname(__FILE__) . '/ext/vendor2/bar/migrations/foo.php';
|
||||
require_once dirname(__FILE__) . '/ext/vendor2/bar/migrations/migration.php';
|
||||
|
||||
class phpbb_extension_extension_base_test extends phpbb_test_case
|
||||
{
|
||||
|
@ -61,19 +64,29 @@ class phpbb_extension_extension_base_test extends phpbb_test_case
|
|||
return array(
|
||||
array(
|
||||
'vendor2/bar',
|
||||
false,
|
||||
array(
|
||||
'\vendor2\bar\migrations\bar',
|
||||
'\vendor2\bar\migrations\foo',
|
||||
'\vendor2\bar\migrations\migration',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'vendor2/bar',
|
||||
true,
|
||||
array(
|
||||
2 => '\vendor2\bar\migrations\migration',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data_test_suffix_get_classes
|
||||
*/
|
||||
public function test_suffix_get_classes($extension_name, $expected)
|
||||
public function test_suffix_get_classes($extension_name, $validate_classes, $expected)
|
||||
{
|
||||
$extension = $this->extension_manager->get_extension($extension_name);
|
||||
$this->assertEquals($expected, self::$reflection_method_get_migration_file_list->invoke($extension, false));
|
||||
$this->assertEquals($expected, self::$reflection_method_get_migration_file_list->invoke($extension, $validate_classes));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue