Skip to content

Commit

Permalink
Don't declare properties dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
kvz committed Aug 2, 2024
1 parent d607daf commit 9df01c8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions test/simple/CurlRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public function testAttributes() {
}

public function testConstructor() {
$request = new CurlRequest(['foo' => 'bar']);
$this->assertEquals('bar', $request->foo);
$request = new CurlRequest(['url' => 'foobar']);
$this->assertEquals('foobar', $request->url);
}

public function testGetCurlOptions() {
Expand Down
6 changes: 4 additions & 2 deletions test/simple/CurlResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
use transloadit\CurlResponse;

class CurlResponseTest extends \PHPUnit\Framework\TestCase {
protected $response;

public function setUp(): void {
$this->response = new CurlResponse();
}
Expand All @@ -17,8 +19,8 @@ public function testAttributes() {
}

public function testConstructor() {
$transloadit = new CurlResponse(['foo' => 'bar']);
$this->assertEquals('bar', $transloadit->foo);
$transloadit = new CurlResponse(['data' => 'foobar']);
$this->assertEquals('foobar', $transloadit->data);
}

public function testParseJson() {
Expand Down
9 changes: 5 additions & 4 deletions test/simple/TransloaditTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
date_default_timezone_set('UTC');

class TransloaditTest extends \PHPUnit\Framework\TestCase {
protected $transloadit;
public function setUp(): void {
$this->transloadit = new Transloadit();
}

public function testConstructor() {
$transloadit = new Transloadit(['foo' => 'bar']);
$this->assertEquals('bar', $transloadit->foo);
$transloadit = new Transloadit(['endpoint' => 'foobar']);
$this->assertEquals('foobar', $transloadit->endpoint);
}

public function testAttributes() {
Expand Down Expand Up @@ -77,11 +78,11 @@ public function testCancelAssembly() {
public function testRequest() {
$this->transloadit->key = 'my-key';
$this->transloadit->secret = 'my-secret';
$request = $this->transloadit->request(['foo' => 'bar'], false);
$request = $this->transloadit->request(['url' => 'foobar'], false);

$this->assertEquals($this->transloadit->key, $request->key);
$this->assertEquals($this->transloadit->secret, $request->secret);
$this->assertEquals('bar', $request->foo);
$this->assertEquals('foobar', $request->url);

// Unfortunately we can't test the $execute parameter because PHP
// is a little annoying. But that's ok for now.
Expand Down

0 comments on commit 9df01c8

Please sign in to comment.