Пример #1
0
 /**
  * Test default values
  */
 public function testDefaults()
 {
     $id = $this->accounts->insert(['license_key' => '123', 'subdomain' => 'afiveone', 'url' => 'https://afiveone.manageprojects.com'])[0];
     $this->assertEquals(1, $id);
     $record = $this->accounts->get($id);
     $this->assertTrue(is_array($record));
     $this->assertEquals(1, $record['_id']);
     $this->assertEquals('123', $record['license_key']);
     $this->assertEquals('afiveone', $record['subdomain']);
     $this->assertEquals('https://afiveone.manageprojects.com', $record['url']);
     $this->assertEquals('UTC', $record['timezone']);
     $this->assertEquals(false, $record['is_paid']);
 }
Пример #2
0
 /**
  * Test record update
  */
 public function testUpdate()
 {
     $this->assertEquals(0, $this->accounts->count());
     $id = $this->accounts->insert(['license_key' => '123', 'subdomain' => 'afiveone', 'url' => 'https://www.activecollab.com'])[0];
     $this->assertEquals(1, $this->accounts->count());
     $this->assertEquals('afiveone', $this->accounts->get($id)['subdomain']);
     $this->assertEquals('123', $this->accounts->get($id)['license_key']);
     $this->accounts->update($id, ['subdomain' => '      farfaraway ', 'license_key' => '456']);
     $this->assertEquals(1, $this->accounts->count());
     $this->assertEquals('farfaraway', $this->accounts->get($id)['subdomain']);
     $this->assertEquals('456', $this->accounts->get($id)['license_key']);
 }
Пример #3
0
 /**
  * Test string modifier
  */
 public function testStringModifier()
 {
     $id = $this->accounts->insert(['license_key' => '123', 'subdomain' => '     afiveone ', 'url' => 'https://www.activecollab.com'])[0];
     $this->assertEquals('afiveone', $this->accounts->get($id)['subdomain']);
 }