Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
fixing the test to be less path sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Orcutt committed Mar 22, 2018
1 parent f1fd919 commit 8b6e7db
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Zynga/Framework/StorableObject/V1/Exporter/ProtobufTest.hh
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,20 @@ class ProtobufTest extends TestCase {
const int MAX_SINT64 = PHP_INT_MAX;
const bool MAX_BOOL = true;

public function getTestFilePath(string $shortPath): string {
$filePath = dirname(__FILE__);
$filePath = dirname($filePath); // strip: Exporter
$filePath = dirname($filePath); // strip: V1
$filePath = dirname($filePath); // strip: StorableObject
$filePath = dirname($filePath); // strip: Framework
$filePath = dirname($filePath); // strip: Zynga
$filePath = dirname($filePath); // strip: src
$filePath .= '/tests/protobuf-java-compat/'. $shortPath;
return $filePath;
}

public function getMinValuesBinary(string $binFile): string {
$filePath = CodePath::getRoot().'/tests/protobuf-java-compat/'.$binFile;
$filePath = $this->getTestFilePath($binFile);
$this->assertFileExists($filePath);
return file_get_contents($filePath);
}
Expand Down

0 comments on commit 8b6e7db

Please sign in to comment.