Merge branch '2015.11-develop' into 2016.03
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 10 Aug 2016 16:26:29 +0000 (18:26 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 10 Aug 2016 16:26:29 +0000 (18:26 +0200)
1  2 
tests/tine20/Timetracker/JsonTest.php
tine20/build.xml

@@@ -58,7 -58,7 +58,7 @@@ class Timetracker_JsonTest extends Time
  
          // checks
          $this->assertEquals($timeaccount->description, $timeaccountData['description']);
-         $this->assertEquals(Tinebase_Core::getUser()->getId(), $timeaccountData['created_by']);
+         $this->assertEquals(Tinebase_Core::getUser()->getId(), $timeaccountData['created_by']['accountId']);
          $this->assertTrue(is_array($timeaccountData['container_id']));
          $this->assertEquals(Tinebase_Model_Container::TYPE_SHARED, $timeaccountData['container_id']['type']);
          $this->assertGreaterThan(0, count($timeaccountData['grants']));
@@@ -83,7 -83,7 +83,7 @@@
  
          // checks
          $this->assertEquals($timeaccount->description, $timeaccountData['description']);
-         $this->assertEquals(Tinebase_Core::getUser()->getId(), $timeaccountData['created_by']);
+         $this->assertEquals(Tinebase_Core::getUser()->getId(), $timeaccountData['created_by']['accountId']);
          $this->assertTrue(is_array($timeaccountData['container_id']));
          $this->assertEquals(Tinebase_Model_Container::TYPE_SHARED, $timeaccountData['container_id']['type']);
  
          // check
          $this->assertEquals($timeaccountData['id'], $timeaccountUpdated['id']);
          $this->assertEquals($timeaccountData['description'], $timeaccountUpdated['description']);
-         $this->assertEquals(Tinebase_Core::getUser()->getId(), $timeaccountUpdated['last_modified_by']);
+         $this->assertEquals(Tinebase_Core::getUser()->getId(), $timeaccountUpdated['last_modified_by']['accountId']);
  
          // cleanup
          $this->_json->deleteTimeaccounts($timeaccountData['id']);
              "operator": "equals",
              "value": "' . $timeaccountData['id'] . '"
          }]';
 -        $paging = '"paging": {
 +        $paging = '{
 +        "paging": {
              "sort": "number",
              "dir": "DESC",
              "start": 0,
              "limit": 50
 -        }';
 +        }}';
 +
          $searchResult = $this->_json->searchTimeaccounts(Zend_Json::decode($searchFilter), Zend_Json::decode($paging));
          $this->assertEquals(1, $searchResult['totalcount']);
          $this->assertEquals(1, count($searchResult['filter']), 'did not get ta filter: ' . print_r($searchResult, TRUE));
  
          // checks
          $this->assertEquals($timesheet->description, $timesheetData['description']);
-         $this->assertEquals(Tinebase_Core::getUser()->getId(), $timesheetData['created_by']);
+         $this->assertEquals(Tinebase_Core::getUser()->getId(), $timesheetData['created_by']['accountId']);
          $this->assertEquals(Tinebase_Core::getUser()->getId(), $timesheetData['account_id']['accountId'], 'account is not resolved');
-         $this->assertEquals(Tinebase_DateTime::now()->toString('Y-m-d'),  $timesheetData['start_date']);
+         $this->assertEquals(Tinebase_DateTime::now()->toString('Y-m-d') . ' 00:00:00',  $timesheetData['start_date']);
  
          // cleanup
          $this->_json->deleteTimeaccounts($timesheetData['timeaccount_id']['id']);
  
          // checks
          $this->assertEquals($timesheet->description, $timesheetData['description']);
-         $this->assertEquals(Tinebase_Core::getUser()->getId(), $timesheetData['created_by']);
+         $this->assertEquals(Tinebase_Core::getUser()->getId(), $timesheetData['created_by']['accountId']);
          $this->assertEquals(Tinebase_Core::getUser()->getId(), $timesheetData['account_id']['accountId'], 'account is not resolved');
          $this->assertEquals($timesheet['timeaccount_id'], $timesheetData['timeaccount_id']['id'], 'timeaccount is not resolved');
  
          // check
          $this->assertEquals($timesheetData['id'], $timesheetUpdated['id']);
          $this->assertEquals($timesheetData['description'], $timesheetUpdated['description']);
-         $this->assertEquals(Tinebase_Core::getUser()->getId(), $timesheetUpdated['last_modified_by']);
+         $this->assertEquals(Tinebase_Core::getUser()->getId(), $timesheetUpdated['last_modified_by']['accountId']);
          $this->assertEquals(Tinebase_Core::getUser()->getId(), $timesheetUpdated['account_id']['accountId'], 'account is not resolved');
          $this->assertEquals($timesheetData['timeaccount_id'], $timesheetUpdated['timeaccount_id']['id'], 'timeaccount is not resolved');
  
          
          $this->assertEquals($bday->setTimezone(Tinebase_Core::getUserTimezone())->toString(), $contactJson['bday']);
      }
 -    
 -    /**
 -     * test and filter
 -     * @see: 0009730: Fix & use Explicit_Related_Record Filter in all applications
 -     */
 -    public function testTimeaccountFailureFilter()
 -    {
 -        $req = Zend_Json::decode('{"params":{"filter":
 -            [{"condition":"OR","filters":[{"condition":"AND","filters":
 -            [{"field":"start_date","operator":"within","value":"weekLast","id":"ext-record-1"},{"field":"account_id","operator":"AND","value":
 -            [{"field":"query","operator":"contains","value":"43518","id":"ext-record-
 -            95"}],"id":"ext-record-2"}],"id":"ext-comp-1074","label":"Stundenzettel"}]}],"paging":
 -            {"sort":"start_date","dir":"ASC","start":0,"limit":50}}'
 -        );
 -    
 -        $feTa = new Timetracker_Frontend_Json();
 -    
 -        $result = $feTa->searchTimesheets($req['params']['filter'], $req['params']['paging']);
 -    
 -        $this->assertArrayHasKey('results', $result);
 -    }
 -    
 +
      /**
       * here we search for all timeaccounts, which are related to an contract with a special
       * internal contact assigned
diff --combined tine20/build.xml
      <!-- ============================================      -->
      <target name="phpunit-exec" depends="clean, phpunit-prepare">
          <property name="testinclude" value="AllTests.php" override="true" />
 -        <property name="includepath" value=".:/usr/share/php/:${configdir}:${project.basedir}:${project.basedir}/library:${project.basedir}/library/zf1ext" override="true" />
 +        <property name="includepath" value=".:/usr/share/php/:${configdir}:${project.basedir}:${project.basedir}/library:${project.basedir}/vendor/zendframework/zendframework1/library" override="true" />
          <property name="testadditionalparams" value="" override="true" />
          <property name="testsuite" value="tine20" override="true" />
          
      <!-- ============================================      -->
      <target name="phpunit-serv" depends="clean, phpunit-prepare">
          <property name="testinclude" value="AllServerTests.php" override="true" />
 -        <property name="includepath" value=".:/usr/share/php/:${configdir}:${project.basedir}:${project.basedir}/library/:${project.basedir}/library/zf1ext" override="true" />
 +        <property name="includepath" value=".:/usr/share/php/:${configdir}:${project.basedir}:${project.basedir}/library/:${project.basedir}/vendor/zendframework/zendframework1/library" override="true" />
          <property name="testadditionalparams" value="" override="true" />
  
          <echo msg="Starting Server Tests..." />
          </copy>
  
          <!-- translations -->
-         <translation-build appName="${name}" />
-         <jsMin targetDir="${builddir}/${name}/js" failOnError="false">
-             <fileset dir="${builddir}/${name}/js">
-                 <include name="*-lang-*-debug.js"/>
-             </fileset>
-         </jsMin>
-         <copy toDir="${project.basedir}/${name}/js">
-             <fileset dir="${builddir}/${name}/js">
-                 <include name="*-lang-*-debug.js" />
-             </fileset>
-         </copy>
-         <copy toDir="${project.basedir}/${name}/js">
-             <fileset dir="${builddir}/${name}/js">
-                 <include name="*-lang-*-debug-min.js" />
-             </fileset>
-             <mapper type="regexp" from="^(.*)-debug-min.js" to="\1.js"/>
-         </copy>
+         <if>
+             <available file="${builddir}/${name}/js" type="dir" property="has_jsdir"/>
+             <then>
+                 <echo message="Building translations..." />
+                 <translation-build appName="${name}" />
+                 <jsMin targetDir="${builddir}/${name}/js" failOnError="false">
+                     <fileset dir="${builddir}/${name}/js">
+                         <include name="*-lang-*-debug.js"/>
+                     </fileset>
+                 </jsMin>
+                 <copy toDir="${project.basedir}/${name}/js">
+                     <fileset dir="${builddir}/${name}/js">
+                         <include name="*-lang-*-debug.js" />
+                     </fileset>
+                 </copy>
+                 <copy toDir="${project.basedir}/${name}/js">
+                     <fileset dir="${builddir}/${name}/js">
+                         <include name="*-lang-*-debug-min.js" />
+                     </fileset>
+                     <mapper type="regexp" from="^(.*)-debug-min.js" to="\1.js"/>
+                 </copy>
+             </then>
+         </if>
      </target>
  
      <!-- ============================================  -->