Skip to content

Commit

Permalink
moved realtests to separate sub directory and ignored from codeclimate
Browse files Browse the repository at this point in the history
  • Loading branch information
hueyl77 committed May 19, 2017
1 parent 34818dc commit 48b2af9
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 34 deletions.
3 changes: 2 additions & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ exclude_paths:
- build/*
- examples/*
- vendor/*
- filestack/FilestackConfig.php
- tests/realtests/*
- filestack/FilestackConfig.php
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ vendor/
coverage/
build/logs/*
tests/testfiles/*
phpmd-report.xml
logs/
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ vendor/bin/phpunit
```

- To generate coverage report, run following command (will generage html files under
directory tests/coverage)
directory coverage/)
```
vendor/bin/phpunit --coverage-html=coverage
```
Expand All @@ -138,9 +138,10 @@ php php-cs-fixer-v2.phar fix tests/
php php-cs-fixer-v2.phar fix examples/
```

- Run PHPMD for CodeClimate checks
- To run PHPMD for CodeClimate checks
```
vendor/bin/phpmd filestack xml phpmd-rules.xml > phpmd-report.xml
vendor/bin/phpmd filestack xml phpmd-rules.xml > logs/phpmd-report-filestack.xml
vendor/bin/phpmd tests xml phpmd-rules.xml > logs/phpmd-report-tests.xml
```
## Issues

Expand Down
10 changes: 5 additions & 5 deletions tests/FilelinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function testFilelinkGetContentNotFound()
$filelink = new Filelink($this->test_file_handle, $this->test_api_key,
$this->test_security, $stub_http_client);

$result = $filelink->getContent();
$filelink->getContent();
}

/**
Expand Down Expand Up @@ -220,7 +220,7 @@ public function testFilelinkDownloadNotFound()
$this->test_security, $stub_http_client);
$destination = __DIR__ . "/testfiles/test.jpg";

$result = $filelink->download($destination);
$filelink->download($destination);
}

/**
Expand Down Expand Up @@ -264,7 +264,7 @@ public function testFilelinkGetMetadataException()
$filelink = new Filelink('some-bad-file-handle', $this->test_api_key,
$this->test_security, $stub_http_client);

$result = $filelink->getMetaData();
$filelink->getMetaData();
}

/**
Expand Down Expand Up @@ -302,7 +302,7 @@ public function testFilelinkDeleteException()
$filelink = new Filelink('gQNI9RF1SG2nRmvmQDMU', $this->test_api_key,
$this->test_security, $stub_http_client);

$result = $filelink->delete();
$filelink->delete();
}

/**
Expand Down Expand Up @@ -371,7 +371,7 @@ public function testFilelinkSaveException()
$this->test_security,
$stub_http_client);

$result = $filelink->save();
$filelink->save();
}

/**
Expand Down
28 changes: 14 additions & 14 deletions tests/FilestackClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function testGetContentNotFound()
$this->test_api_key,
$this->test_security,
$stub_http_client);
$result = $client->getContent('some-bad-file-handle-testing');
$client->getContent('some-bad-file-handle-testing');
}

/**
Expand Down Expand Up @@ -114,7 +114,7 @@ public function testGetMetadataException()
$this->test_security,
$stub_http_client
);
$filelink = $client->getMetaData('some-bad-file-handle-testing');
$client->getMetaData('some-bad-file-handle-testing');
}

/**
Expand Down Expand Up @@ -299,7 +299,7 @@ public function testconvertVideoThrowsException()

$source = 'Q5eBTKldRfCSuEjUYuAz';
$output_options = [];
$uuid = $client->convertVideo($source, 'm4a', $output_options);
$client->convertVideo($source, 'm4a', $output_options);
}

/**
Expand Down Expand Up @@ -346,7 +346,7 @@ public function testDeleteException()
);

$test_handle = 'some-bad-file-handle-testing';
$result = $client->delete($test_handle);
$client->delete($test_handle);
}

/**
Expand Down Expand Up @@ -405,7 +405,7 @@ public function testDownloadNotFound()
$this->test_security,
$stub_http_client
);
$result = $client->download('some-bad-file-handle-testing', $destination);
$client->download('some-bad-file-handle-testing', $destination);
}

/**
Expand Down Expand Up @@ -479,7 +479,7 @@ public function testUploadInvalidKey()
$this->test_security,
$stub_http_client
);
$filelink = $client->upload($this->test_filepath);
$client->upload($this->test_filepath);
}

/**
Expand Down Expand Up @@ -531,7 +531,7 @@ public function testUploadSuccessWithOptions()
'Filename' => 'somefilename.jpg',
];

$filelink = $client->upload($this->test_filepath);
$filelink = $client->upload($this->test_filepath, $extras);

$this->assertNotNull($filelink);
}
Expand Down Expand Up @@ -605,10 +605,10 @@ public function testOverwriteException()
$stub_http_client
);

$filelink = $client->overwrite(
$this->test_filepath,
'some-bad-file-handle-testing'
);
$client->overwrite(
$this->test_filepath,
'some-bad-file-handle-testing'
);
}

/**
Expand Down Expand Up @@ -700,7 +700,7 @@ public function testDebuggingThrowsException()
'resize' => ['w' => 'test-value']
];

$json_response = $client->debug($this->test_file_handle, $transform_tasks);
$client->debug($this->test_file_handle, $transform_tasks);
}

/**
Expand All @@ -714,7 +714,7 @@ public function testInvalidMethodThrowExceptions()
$client = new FilestackClient(
$this->test_api_key,
$this->test_security);
$result = $client->someInvalidMethod('test');
$client->someInvalidMethod('test');
}

/**
Expand Down Expand Up @@ -774,6 +774,6 @@ public function testZipFilesNotFound()
'some-bad-file-handle-or-url'
];

$contents = $client->zip($sources);
$client->zip($sources);
}
}
9 changes: 5 additions & 4 deletions tests/FilestackSecurityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function testSecurityInvalidOptions()

$options = ['some-invalid-option' => 'some-value'];
$security = new FilestackSecurity($this->test_secret, $options);
$this->assertNull($security);
}

/*
Expand Down Expand Up @@ -64,7 +65,7 @@ public function testSecurityDownload()
$security = new FilestackSecurity($this->test_secret, $options);
$client = new FilestackClient(
$this->test_api_key,
$this->test_security,
$security,
$stub_http_client
);
$result = $client->download($this->test_file_url, $destination);
Expand Down Expand Up @@ -96,7 +97,7 @@ public function testDownloadFailedNoCreds()
null,
$stub_http_client
);
$result = $client->download($this->test_file_url, $destination);
$client->download($this->test_file_url, $destination);
}

/*
Expand All @@ -121,10 +122,10 @@ public function testDownloadFailedInvalidCreds()
$security = new FilestackSecurity('some-invalid-secret-test');
$client = new FilestackClient(
$this->test_api_key,
$this->test_security,
$security,
$stub_http_client
);
$result = $client->download($this->test_file_url, $destination);
$client->download($this->test_file_url, $destination);
}

/*
Expand Down
12 changes: 6 additions & 6 deletions tests/FilestackTransformTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function testTransformationFailed()

$filelink = new Filelink($this->test_file_handle, $this->test_api_key,
$this->test_security, $stub_http_client);
$contents = $filelink->transform($transform_tasks);
$filelink->transform($transform_tasks);
}

/**
Expand All @@ -134,7 +134,7 @@ public function testTransformInvalidTaskThrowsException()

$filelink = new Filelink($this->test_file_handle, $this->test_api_key,
$this->test_security, $stub_http_client);
$contents = $filelink->transform($transform_tasks);
$filelink->transform($transform_tasks);
}

/**
Expand All @@ -160,7 +160,7 @@ public function testTransformInvalidAttrThrowsException()

$filelink = new Filelink($this->test_file_handle, $this->test_api_key,
$this->test_security, $stub_http_client);
$contents = $filelink->transform($transform_tasks);
$filelink->transform($transform_tasks);
}

/**
Expand Down Expand Up @@ -469,11 +469,11 @@ public function testCropSuccess()
$this->test_api_key,
$this->test_security);

$x = 10;
$y = 10;
$x_coordinate = 10;
$y_coordinate = 10;
$width = 200;
$height = 200;
$filelink->crop($x, $y, $width, $height);
$filelink->crop($x_coordinate, $y_coordinate, $width, $height);

$expected_transform_str = 'crop=d:'. urlencode('[10,10,200,200]');
$expected_url = sprintf('%s/security=policy:%s,signature:%s/%s/%s',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 48b2af9

Please sign in to comment.