From 940f5239cfcc2d668d2c15e94eae65a02b024a70 Mon Sep 17 00:00:00 2001 From: Trevor Suarez Date: Fri, 14 Jun 2013 19:38:32 -0400 Subject: [PATCH] PHP 5.4.15 or 5.4.16 fixed a file extension type handler, causing an old test to fail. This fixes that. :) --- .../OneMightyRoar/PhpFileManager/Tests/FileObjectTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/OneMightyRoar/PhpFileManager/Tests/FileObjectTest.php b/tests/OneMightyRoar/PhpFileManager/Tests/FileObjectTest.php index 9f6e50c..e083c68 100644 --- a/tests/OneMightyRoar/PhpFileManager/Tests/FileObjectTest.php +++ b/tests/OneMightyRoar/PhpFileManager/Tests/FileObjectTest.php @@ -394,11 +394,16 @@ public function testGetExtension() $this->assertSame('jpeg', $wrapped_binary->getExtension()); $this->assertSame('plain', $wrapped_base64->getExtension()); - $this->assertSame('c++', $wrapped_binary_php->getExtension()); $this->assertSame('jpg', $raw_binary->getExtension()); $this->assertSame('base64', $raw_base64->getExtension()); $this->assertSame('php', $raw_binary_php->getExtension()); + /** + * __FILE__ may show as C++ or PHP, depending on the version + * This should be fixed as of PHP 5.4.15 or 5.4.16 (not exactly sure) + */ + $this->assertTrue(in_array($wrapped_binary_php->getExtension(), array('c++', 'php'))); + // With dot? $this->assertNotContains('.', $wrapped_binary->getExtension(false)); $this->assertContains('.', $wrapped_binary->getExtension(true));