Skip to content

Commit

Permalink
Merge pull request #32686 from mdeweerd/fix/phpunit.win
Browse files Browse the repository at this point in the history
FIX ci: Remove exit from SocieteTest, include company.lib in Societe.class.php which uses getCountry
  • Loading branch information
eldy authored Jan 16, 2025
2 parents 619392e + eadf4c9 commit e2b3b63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions htdocs/societe/class/societe.class.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/* Copyright (C) 2002-2006 Rodolphe Quiedeville <[email protected]>
* Copyright (C) 2004-2021 Laurent Destailleur <[email protected]>
* Copyright (C) 2004 Eric Seigne <[email protected]>
Expand All @@ -20,7 +21,7 @@
* Copyright (C) 2022 ButterflyOfFire <[email protected]>
* Copyright (C) 2023-2024 Alexandre Janniaux <[email protected]>
* Copyright (C) 2024 William Mead <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024-2025 MDW <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -45,6 +46,7 @@
require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonsocialnetworks.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonpeople.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';


Expand Down Expand Up @@ -3192,7 +3194,7 @@ public function getTypeUrl($withpicto = 0, $option = '', $notooltip = 0, $tag =
if (empty($option) || preg_match('/customer/', $option)) {
if (($this->client == 1 || $this->client == 3) && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) {
$s .= '<'.$tag.' class="customer-back" title="'.dolPrintHTMLForAttribute($langs->trans("Customer")).'"';
$s.= $tag == 'a' ? ' href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id.'"' : '';
$s .= $tag == 'a' ? ' href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id.'"' : '';
$s .= '>'.dol_substr($langs->trans("Customer"), 0, 1).'</'.$tag.'>';
}
}
Expand Down
3 changes: 2 additions & 1 deletion test/phpunit/SocieteTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php

/* Copyright (C) 2010 Laurent Destailleur <[email protected]>
* Copyright (C) 2023 Alexandre Janniaux <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
* Copyright (C) 2025 MDW <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -100,7 +102,6 @@ public function testSocieteCreate()
$localobject->country_code = 'ES';

$result = $localobject->create($user);
var_dump($localobject);exit;

print __METHOD__." result=".$result."\n";
$this->assertLessThanOrEqual($result, 0);
Expand Down

0 comments on commit e2b3b63

Please sign in to comment.