forked from loafle/openapi-generator-original
		
	* Bump minimum required version to PHP7.1 ref: http://php.net/supported-versions.php * Bump phpunit * Update [api|model]_test.mustache * Update samples bin/openapi3/php-petstore.sh * Update namespace of PHPUnit ("tests" folder) * `setExpectedException` is deleted in PHPUnit 7.4 * Update namespace of "Assert" class * The attribute 'name' is required * Add anotation to exclude the test from risky testcheck * Update samples (samples/client/petstore/php) * Apply updates to "test" in openapi2 folder (samples/client/petstore/php)b3495ecbfe15e00ae89d2fc6917d130d016c00ed* Install php7.1 * Switch to php7 * Update samples (security) bin/security/php-petstore.sh
		
			
				
	
	
		
			28 lines
		
	
	
		
			979 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			979 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace OpenAPI\Client;
 | 
						|
 | 
						|
use PHPUnit\Framework\TestCase;
 | 
						|
 | 
						|
// test object serializer
 | 
						|
class ObjectSerializerTest extends TestCase
 | 
						|
{
 | 
						|
    // test sanitizeFilename
 | 
						|
    public function testSanitizeFilename()
 | 
						|
    {
 | 
						|
        // initialize the API client
 | 
						|
        $s = new ObjectSerializer();
 | 
						|
 | 
						|
        $this->assertSame("sun.gif", $s->sanitizeFilename("sun.gif"));
 | 
						|
        $this->assertSame("sun.gif", $s->sanitizeFilename("../sun.gif"));
 | 
						|
        $this->assertSame("sun.gif", $s->sanitizeFilename("/var/tmp/sun.gif"));
 | 
						|
        $this->assertSame("sun.gif", $s->sanitizeFilename("./sun.gif"));
 | 
						|
        
 | 
						|
        $this->assertSame("sun", $s->sanitizeFilename("sun"));
 | 
						|
        $this->assertSame("sun.gif", $s->sanitizeFilename("..\sun.gif"));
 | 
						|
        $this->assertSame("sun.gif", $s->sanitizeFilename("\var\tmp\sun.gif"));
 | 
						|
        $this->assertSame("sun.gif", $s->sanitizeFilename("c:\var\tmp\sun.gif"));
 | 
						|
        $this->assertSame("sun.gif", $s->sanitizeFilename(".\sun.gif"));
 | 
						|
    }
 | 
						|
}
 |