diff --git a/docs/development/running-tests/fixtures.md b/docs/development/running-tests/fixtures.md new file mode 100644 index 000000000..9ed4b97ee --- /dev/null +++ b/docs/development/running-tests/fixtures.md @@ -0,0 +1,8 @@ +# Adding fixture data + +You can use this workflow for identifying and capturing fixture changes: +- load existing fixture data by running `load-fixtures` at the studio command prompt +- Take a complete snapshot of the database `dump-sql > .scratch/snapshot.before-changes.sql` +- Create new records using the UI +- Take a complete snapshot `dump-sql > .scratch/snapshot.after-changes.sql` +- Open up the two .sql files in a visual diff viewer and manually transplant the added records over to their appropriate fixture files in the repo \ No newline at end of file diff --git a/php-classes/Emergence/Git/Source.php b/php-classes/Emergence/Git/Source.php index 9ad0ca5e4..5ab39253e 100644 --- a/php-classes/Emergence/Git/Source.php +++ b/php-classes/Emergence/Git/Source.php @@ -182,11 +182,11 @@ public function getDeployKey() public function setDeployKey(KeyPair $keyPair) { $privateKeyPath = $this->getPrivateKeyPath(); - file_put_contents($privateKeyPath, $keyPair->getPrivateKey().PHP_EOL); + file_put_contents($privateKeyPath, str_replace("\r\n", "\n", $keyPair->getPrivateKey()).PHP_EOL); chmod($privateKeyPath, 0600); $publicKeyPath = $this->getPublicKeyPath(); - file_put_contents($publicKeyPath, $keyPair->getPublicKey().PHP_EOL); + file_put_contents($publicKeyPath, str_replace("\r\n", "\n", $keyPair->getPublicKey()).PHP_EOL); chmod($publicKeyPath, 0600); $this->deployKey = $keyPair;