diff --git a/includes/model/EventConfig_model.php b/includes/model/EventConfig_model.php index f5846870..112ad457 100644 --- a/includes/model/EventConfig_model.php +++ b/includes/model/EventConfig_model.php @@ -64,7 +64,7 @@ function EventConfig_update( ); } - return (bool)DB::update(' + return DB::update(' UPDATE `EventConfig` SET `event_name` = ?, `buildup_start_date` = ?, diff --git a/includes/model/ShiftsFilter.php b/includes/model/ShiftsFilter.php index 47ef50d7..3b691b55 100644 --- a/includes/model/ShiftsFilter.php +++ b/includes/model/ShiftsFilter.php @@ -9,12 +9,6 @@ namespace Engelsystem; */ class ShiftsFilter { - /** - * How long can the time interval be? - * 86400 = one day - */ - const MAX_DURATION = 86400; - /** * Shift is completely full. */ @@ -98,9 +92,6 @@ class ShiftsFilter */ public function setEndTime($endTime) { - if ($endTime - $this->startTime > ShiftsFilter::MAX_DURATION) { - $endTime = $this->startTime + ShiftsFilter::MAX_DURATION; - } $this->endTime = $endTime; } diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php index b0269362..21abc888 100644 --- a/includes/model/Shifts_model.php +++ b/includes/model/Shifts_model.php @@ -266,10 +266,6 @@ function Shift_signup_allowed_angel( ) { $free_entries = Shift_free_entries($needed_angeltype, $shift_entries); - if ($user['Gekommen'] == 0) { - return new ShiftSignupState(ShiftSignupState::SHIFT_ENDED, $free_entries); - } - if ($user_shifts == null) { $user_shifts = Shifts_by_user($user); } diff --git a/phpunit.xml b/phpunit.xml index 29bfdba5..b868096c 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -16,7 +16,8 @@ ./include/ ./public/ - + ./src/ + diff --git a/src/Database/Db.php b/src/Database/Db.php index c1efa058..4116ffda 100644 --- a/src/Database/Db.php +++ b/src/Database/Db.php @@ -81,31 +81,31 @@ class Db } /** - * Run a insert query + * Run an insert query * * @param string $query * @param array $bindings - * @return bool + * @return int|bool */ public static function insert($query, array $bindings = []) { self::query($query, $bindings); - return self::$lastStatus; + return (self::$lastStatus ? self::$stm->rowCount() : false); } /** - * Run a update query + * Run an update query * * @param string $query * @param array $bindings - * @return int|null + * @return int|bool */ public static function update($query, array $bindings = []) { self::query($query, $bindings); - return (self::$lastStatus ? self::$stm->rowCount() : null); + return (self::$lastStatus ? self::$stm->rowCount() : false); } /** @@ -113,13 +113,13 @@ class Db * * @param string $query * @param array $bindings - * @return int|null + * @return int|bool */ public static function delete($query, array $bindings = []) { self::query($query, $bindings); - return (self::$lastStatus ? self::$stm->rowCount() : null); + return (self::$lastStatus ? self::$stm->rowCount() : false); } /** diff --git a/test/model/LogEntriesModelTest.php b/test/model/LogEntriesModelTest.php index 4da6fd4b..25d46fc4 100644 --- a/test/model/LogEntriesModelTest.php +++ b/test/model/LogEntriesModelTest.php @@ -1,9 +1,11 @@ assertNotFalse(LogEntry_create('test', 'test_LogEntry_create')); - + // There should be one more log entry now $this->assertEquals(count(LogEntries()), $count + 1); } diff --git a/test/model/RoomModelTest.php b/test/model/RoomModelTest.php index 9c91939d..135a6108 100644 --- a/test/model/RoomModelTest.php +++ b/test/model/RoomModelTest.php @@ -1,9 +1,11 @@ create_Room(); - + $room = Room($this->room_id); - + $this->assertNotFalse($room); $this->assertNotNull($room); $this->assertEquals($room['Name'], 'test'); - - $this->assertNull(Room(-1)); + + $this->assertNull(Room(- 1)); } /**