Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
RepositoryApiTest.php
1 <?php
2 /**
3  * Gentics Portal.Node PHP
4  * Author & Copyright (c) by Gentics Software GmbH
5  * sales@gentics.com
6  * http://www.gentics.com
7  * Licenses can be found in the LICENSE.txt file in the root-folder of this installation
8  * You must not use this software without a valid license agreement.
9  *
10  */
11 class RepositoryApiTest extends CTestCase
12 {
13  /**
14  * @var RepositoryApi
15  */
16  private $api;
17 
18  public function setUp()
19  {
20  $this->api = $this->getMock('RepositoryApi',array('getCmsObject','getContentAttributes', 'getBinaryContent', 'getLastModificationTime'));
21  }
22 
23  public function testGetCMSobject()
24  {
25  $this->api
26  ->expects($this->once())
27  ->method('getCmsObject')
28  ->will($this->returnValue(array()));
29  $cmsObject = $this->api->getCMSobject('/page');
30  $this->assertTrue(is_array($cmsObject));
31  }
32 
33  public function testGetContentAttributes()
34  {
35  $this->api
36  ->expects($this->once())
37  ->method('getContentAttributes')
38  ->will($this->returnValue(array()));
39  $cmsObject = $this->api->getContentAttributes('/page', array());
40  $this->assertTrue(is_array($cmsObject));
41  }
42 
43  public function testGetBinaryContent()
44  {
45  $this->api
46  ->expects($this->once())
47  ->method('getBinaryContent')
48  ->will($this->returnValue(array()));
49  $cmsObject = $this->api->getBinaryContent('/page');
50  $this->assertTrue(is_array($cmsObject));
51  }
52 
53  public function testGetLastModificationTime()
54  {
55  $this->api
56  ->expects($this->once())
57  ->method('getLastModificationTime')
58  ->will($this->returnValue(65125121312));
59  $cmsObject = $this->api->getLastModificationTime('/page');
60  $this->assertEquals(65125121312,$cmsObject);
61  }
62 }