From 0cd02ce03ebde8517a771e3f46eaa16096482cd3 Mon Sep 17 00:00:00 2001 From: bellord13 Date: Fri, 21 Apr 2023 02:44:25 +0300 Subject: [PATCH] fix --- tests/CollectionTest.php | 6 +++--- tests/index.php | 9 +++++---- tests/loggerTest.php | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/CollectionTest.php b/tests/CollectionTest.php index fe550a8..54ebfbd 100644 --- a/tests/CollectionTest.php +++ b/tests/CollectionTest.php @@ -110,8 +110,8 @@ kit.ready(['collection', 'testing', 'flexKit'], function () { assertSame(3, collection.keys().count(), 'keys'); - xOb = {1: 1, 100: 100}; - x = new kit.Collection(xOb); + var xOb = {1: 1, 100: 100}; + var x = new kit.Collection(xOb); x.push(200); assertSame(200, x.last(), 'object push last'); x.push(0); @@ -139,7 +139,7 @@ kit.ready(['collection', 'testing', 'flexKit'], function () { assertSame(33, x.get('as', 33), 'get after forget'); xOb = {1: 10, 100: 101}; - x = new kit.Collection(xOb); + var x = new kit.Collection(xOb); assertSame(101, x.pull(100), 'pull'); assertSame(1, x.length, 'length after pull'); diff --git a/tests/index.php b/tests/index.php index 35481d0..50ca7a4 100644 --- a/tests/index.php +++ b/tests/index.php @@ -56,7 +56,11 @@ } data.kit.ready([], function () { setTimeout(function () { - var result = {}; + var result = { + fail: new kit.Collection(), + warn: new kit.Collection(), + pass: new kit.Collection(), + }; var countTest = 0; if(!data.kit.service.logger){ return; @@ -65,9 +69,6 @@ function pushResult(log){ var acceptKeys = new kit.Collection(['fail', 'warn', 'pass']); acceptKeys.each(function (key) { - if(!result.hasOwnProperty(key)) { - result[key] = new kit.Collection(); - } if(!support.isObject(log.message)) { return; } diff --git a/tests/loggerTest.php b/tests/loggerTest.php index 233cbdf..5a9e67a 100644 --- a/tests/loggerTest.php +++ b/tests/loggerTest.php @@ -16,10 +16,10 @@ $APPLICATION->ShowHead(); ?>