Update tests to handle related plugins

This commit is contained in:
claudiulodro 2017-08-08 10:31:06 -07:00
parent c486cea531
commit e89bef3d52
1 changed files with 24 additions and 8 deletions

View File

@ -75,16 +75,32 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case {
),
);
$new_version = '4.0.0';
$this->assertEquals( array(), $this->updates->get_untested_plugins( $new_version, $release, false ) );
$untested = $this->updates->get_untested_plugins( $new_version, $release );
$this->assertArrayNotHasKey( 'test/test.php', $untested );
$this->assertArrayNotHasKey( 'test2/test2.php', $untested );
$this->assertArrayNotHasKey( 'test3/test3.php', $untested );
$this->assertArrayNotHasKey( 'test4/test4.php', $untested );
$new_version = '3.9.0';
$this->assertEquals( array(), $this->updates->get_untested_plugins( $new_version, $release, false ) );
$untested = $this->updates->get_untested_plugins( $new_version, $release );
$this->assertArrayNotHasKey( 'test/test.php', $untested );
$this->assertArrayNotHasKey( 'test2/test2.php', $untested );
$this->assertArrayNotHasKey( 'test3/test3.php', $untested );
$this->assertArrayNotHasKey( 'test4/test4.php', $untested );
$new_version = '4.3.0';
$this->assertEquals( array(), $this->updates->get_untested_plugins( $new_version, $release, false ) );
$untested = $this->updates->get_untested_plugins( $new_version, $release );
$this->assertArrayNotHasKey( 'test/test.php', $untested );
$this->assertArrayNotHasKey( 'test2/test2.php', $untested );
$this->assertArrayNotHasKey( 'test3/test3.php', $untested );
$this->assertArrayNotHasKey( 'test4/test4.php', $untested );
$new_version = '4.0.2';
$this->assertEquals( array(), $this->updates->get_untested_plugins( $new_version, $release ) );
$untested = $this->updates->get_untested_plugins( $new_version, $release );
$this->assertArrayNotHasKey( 'test/test.php', $untested );
$this->assertArrayNotHasKey( 'test2/test2.php', $untested );
$this->assertArrayNotHasKey( 'test3/test3.php', $untested );
$this->assertArrayNotHasKey( 'test4/test4.php', $untested );
}
/**
@ -110,13 +126,13 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case {
),
);
$new_version = '4.0.0';
$this->assertEquals( $this->plugins, $this->updates->get_untested_plugins( $new_version, $release ) );
$this->assertArraySubset( $this->plugins, $this->updates->get_untested_plugins( $new_version, $release ) );
$new_version = '4.3.0';
$this->assertEquals( $this->plugins, $this->updates->get_untested_plugins( $new_version, $release ) );
$this->assertArraySubset( $this->plugins, $this->updates->get_untested_plugins( $new_version, $release ) );
$new_version = '4.0.2';
$this->assertEquals( $this->plugins, $this->updates->get_untested_plugins( $new_version, $release ) );
$this->assertArraySubset( $this->plugins, $this->updates->get_untested_plugins( $new_version, $release ) );
}
/**
@ -220,7 +236,7 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case {
$release = 'major';
$new_version = '5.0.0';
$this->assertEquals( array( 'test/test.php' => $this->plugins['test/test.php'] ), $this->updates->get_untested_plugins( $new_version, $release ) );
$this->assertArraySubset( array( 'test/test.php' => $this->plugins['test/test.php'] ), $this->updates->get_untested_plugins( $new_version, $release ) );
$release = 'minor';
$new_version = '4.1.0';