diff --git a/tests/Phing/Test/Type/Selector/ReadableSelectorTest.php b/tests/Phing/Test/Type/Selector/ReadableSelectorTest.php new file mode 100644 index 0000000000..d156a0dda5 --- /dev/null +++ b/tests/Phing/Test/Type/Selector/ReadableSelectorTest.php @@ -0,0 +1,52 @@ +. + */ + +namespace Phing\Test\Type\Selector; + +use Phing\Test\Support\BuildFileTest; + +/** + * Class ReadableSelectorTest. + * + * Test cases for isReadable selectors. + * + * @internal + */ +class ReadableSelectorTest extends BuildFileTest +{ + public function setUp(): void + { + $this->configureProject( + PHING_TEST_BASE . '/etc/types/selectors/ReadableSelectorTest.xml' + ); + $this->executeTarget('setup'); + } + + public function tearDown(): void + { + $this->executeTarget('clean'); + } + + public function testReadable(): void + { + $this->executeTarget(__FUNCTION__); + $this->assertPropertySet('selected'); + } +} diff --git a/tests/Phing/Test/Type/Selector/ReadWriteTest.php b/tests/Phing/Test/Type/Selector/WritableSelectorTest.php similarity index 67% rename from tests/Phing/Test/Type/Selector/ReadWriteTest.php rename to tests/Phing/Test/Type/Selector/WritableSelectorTest.php index 24c501e645..e454354e69 100644 --- a/tests/Phing/Test/Type/Selector/ReadWriteTest.php +++ b/tests/Phing/Test/Type/Selector/WritableSelectorTest.php @@ -23,18 +23,18 @@ use Phing\Test\Support\BuildFileTest; /** - * Class ReadWriteTest. + * Class ReadableSelectorTest. * - * Test cases for isReadable/isWritable selectors. + * Test cases for isReadable selectors. * * @internal */ -class ReadWriteTest extends BuildFileTest +class WritableSelectorTest extends BuildFileTest { public function setUp(): void { $this->configureProject( - PHING_TEST_BASE . '/etc/types/selectors/ReadWriteTest.xml' + PHING_TEST_BASE . '/etc/types/selectors/WritableSelectorTest.xml' ); $this->executeTarget('setup'); } @@ -44,22 +44,10 @@ public function tearDown(): void $this->executeTarget('clean'); } - public function testReadable(): void - { - $this->executeTarget(__FUNCTION__); - $project = $this->getProject(); - $output = $project->getProperty('output'); - $file = $project->getProperty('file'); - $this->assertTrue(is_readable(sprintf('%s/%s', $output, $file))); - } - public function testWritable(): void { $this->executeTarget(__FUNCTION__); - $project = $this->getProject(); - $output = $project->getProperty('output'); - $file = $project->getProperty('file'); - $this->assertTrue(is_writable(sprintf('%s/%s', $output, $file))); + $this->assertPropertySet('selected'); } public function testUnwritable(): void @@ -68,6 +56,6 @@ public function testUnwritable(): void $project = $this->getProject(); $output = $project->getProperty('output'); $file = $project->getProperty('file'); - $this->assertFalse(is_writable(sprintf('%s/%s', $output, $file))); + $this->assertIsNotWritable(sprintf('%s/%s', $output, $file)); } } diff --git a/tests/etc/types/selectors/ReadableSelectorTest.xml b/tests/etc/types/selectors/ReadableSelectorTest.xml new file mode 100644 index 0000000000..f41d08d01c --- /dev/null +++ b/tests/etc/types/selectors/ReadableSelectorTest.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/etc/types/selectors/ReadWriteTest.xml b/tests/etc/types/selectors/WritableSelectorTest.xml similarity index 89% rename from tests/etc/types/selectors/ReadWriteTest.xml rename to tests/etc/types/selectors/WritableSelectorTest.xml index c4e4457f65..3565785a82 100644 --- a/tests/etc/types/selectors/ReadWriteTest.xml +++ b/tests/etc/types/selectors/WritableSelectorTest.xml @@ -35,16 +35,12 @@ - - - - - - - - - + + + + +