Fix some more tests that don't work anymore due to things changing / files moved / other reasons

This commit is contained in:
nathan 2021-09-30 13:15:37 -06:00
parent 1dc9dd0c6b
commit 806aa542a1
4 changed files with 66 additions and 60 deletions

View File

@ -22,11 +22,13 @@ require_once realpath(__DIR__.'/../WidgetBaseTest.php');
use EGroupware\Api\Etemplate; use EGroupware\Api\Etemplate;
class EntryTest extends \EGroupware\Api\Etemplate\WidgetBaseTest { class ContactEntryTest extends \EGroupware\Api\Etemplate\WidgetBaseTest
{
const TEST_TEMPLATE = 'api.entry_test_contact'; const TEST_TEMPLATE = 'api.entry_test_contact';
public static function setUpBeforeClass() : void { public static function setUpBeforeClass() : void
{
parent::setUpBeforeClass(); parent::setUpBeforeClass();
} }

View File

@ -12,6 +12,7 @@
namespace EGroupware\Api\Storage; namespace EGroupware\Api\Storage;
require_once __DIR__ . '/../LoggedInTest.php';
use EGroupware\Api\LoggedInTest as LoggedInTest; use EGroupware\Api\LoggedInTest as LoggedInTest;
class CustomfieldsTest extends LoggedInTest class CustomfieldsTest extends LoggedInTest
@ -20,19 +21,19 @@ class CustomfieldsTest extends LoggedInTest
protected $customfields = null; protected $customfields = null;
protected $simple_field = array( protected $simple_field = array(
'app' => self::APP, 'app' => self::APP,
'name' => 'test_field', 'name' => 'test_field',
'label' => 'Custom field', 'label' => 'Custom field',
'type' => 'text', 'type' => 'text',
'type2' => array(), 'type2' => array(),
'help' => 'Custom field created for automated testing by CustomfieldsTest', 'help' => 'Custom field created for automated testing by CustomfieldsTest',
'values' => null, 'values' => null,
'len' => null, 'len' => null,
'rows' => null, 'rows' => null,
'order' => null, 'order' => null,
'needed' => null, 'needed' => null,
'private' => array() 'private' => array()
); );
public function tearDown(): void public function tearDown(): void
{ {
@ -209,35 +210,35 @@ class CustomfieldsTest extends LoggedInTest
// Expected options, file // Expected options, file
return array( return array(
array(array( array(array(
'' => 'Select', '' => 'Select',
'Α'=> 'α Alpha', 'Α' => 'α Alpha',
'Β'=> 'β Beta', 'Β' => 'β Beta',
'Γ'=> 'γ Gamma', 'Γ' => 'γ Gamma',
'Δ'=> 'δ Delta', 'Δ' => 'δ Delta',
'Ε'=> 'ε Epsilon', 'Ε' => 'ε Epsilon',
'Ζ'=> 'ζ Zeta', 'Ζ' => 'ζ Zeta',
'Η'=> 'η Eta', 'Η' => 'η Eta',
'Θ'=> 'θ Theta', 'Θ' => 'θ Theta',
'Ι'=> 'ι Iota', 'Ι' => 'ι Iota',
'Κ'=> 'κ Kappa', 'Κ' => 'κ Kappa',
'Λ'=> 'λ Lambda', 'Λ' => 'λ Lambda',
'Μ'=> 'μ Mu', 'Μ' => 'μ Mu',
'Ν'=> 'ν Nu', 'Ν' => 'ν Nu',
'Ξ'=> 'ξ Xi', 'Ξ' => 'ξ Xi',
'Ο'=> 'ο Omicron', 'Ο' => 'ο Omicron',
'Π'=> 'π Pi', 'Π' => 'π Pi',
'Ρ'=> 'ρ Rho', 'Ρ' => 'ρ Rho',
'Σ'=> 'σ Sigma', 'Σ' => 'σ Sigma',
'Τ'=> 'τ Tau', 'Τ' => 'τ Tau',
'Υ'=> 'υ Upsilon', 'Υ' => 'υ Upsilon',
'Φ'=> 'φ Phi', 'Φ' => 'φ Phi',
'Χ'=> 'χ Chi', 'Χ' => 'χ Chi',
'Ψ'=> 'ψ Psi', 'Ψ' => 'ψ Psi',
'Ω'=> 'ω Omega' 'Ω' => 'ω Omega'
), 'greek_options.php'), ), 'greek_options.php'),
array(array( array(array(
'View Subs' => "egw_open('','infolog','list',{action:'sp',action_id:widget.getRoot().getArrayMgr('content').getEntry('info_id')},'infolog','infolog');" 'View Subs' => "egw_open('','infolog','list',{action:'sp',action_id:widget.getRoot().getArrayMgr('content').getEntry('info_id')},'infolog','infolog');"
), 'infolog_subs_option.php') ), 'infolog_subs_option.php')
); );
} }
@ -302,8 +303,8 @@ class CustomfieldsTest extends LoggedInTest
protected function get_another_user() protected function get_another_user()
{ {
$accounts = $GLOBALS['egw']->accounts->search(array( $accounts = $GLOBALS['egw']->accounts->search(array(
'type' => 'accounts' 'type' => 'accounts'
)); ));
unset($accounts[$GLOBALS['egw_info']['user']['account_id']]); unset($accounts[$GLOBALS['egw_info']['user']['account_id']]);
if(count($accounts) == 0) if(count($accounts) == 0)
{ {

View File

@ -14,8 +14,10 @@
namespace EGroupware\Api\Storage; namespace EGroupware\Api\Storage;
require_once __DIR__ . '/../../src/Storage/Tracking.php';
class TestTracking extends Tracking { class TestTracking extends Tracking
{
var $app = 'test'; var $app = 'test';

View File

@ -12,6 +12,7 @@
namespace EGroupware\Api\Storage; namespace EGroupware\Api\Storage;
require_once __DIR__ . '/../LoggedInTest.php';
require_once __DIR__ . '/TestTracking.php'; require_once __DIR__ . '/TestTracking.php';
use EGroupware\Api; use EGroupware\Api;
@ -22,18 +23,18 @@ class TrackingTest extends LoggedInTest
const APP = 'test'; const APP = 'test';
protected $simple_field = array( protected $simple_field = array(
'app' => self::APP, 'app' => self::APP,
'name' => 'test_field', 'name' => 'test_field',
'label' => 'Custom field', 'label' => 'Custom field',
'type' => 'text', 'type' => 'text',
'type2' => array(), 'type2' => array(),
'help' => 'Custom field created for automated testing by CustomfieldsTest', 'help' => 'Custom field created for automated testing by CustomfieldsTest',
'values' => null, 'values' => null,
'len' => null, 'len' => null,
'rows' => null, 'rows' => null,
'order' => null, 'order' => null,
'needed' => null, 'needed' => null,
'private' => array() 'private' => array()
); );
/** /**
@ -57,8 +58,8 @@ class TrackingTest extends LoggedInTest
// Get another user // Get another user
$accounts = $GLOBALS['egw']->accounts->search(array( $accounts = $GLOBALS['egw']->accounts->search(array(
'type' => 'accounts' 'type' => 'accounts'
)); ));
unset($accounts[$GLOBALS['egw_info']['user']['account_id']]); unset($accounts[$GLOBALS['egw_info']['user']['account_id']]);
if(count($accounts) == 0) if(count($accounts) == 0)
{ {