PHPackages                             merterhk/smarttest - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. merterhk/smarttest

ActiveLibrary[Testing &amp; Quality](/categories/testing)

merterhk/smarttest
==================

06PHP

Since Jan 9Pushed 10y ago1 watchersCompare

[ Source](https://github.com/merterhk/smarttest)[ Packagist](https://packagist.org/packages/merterhk/smarttest)[ RSS](/packages/merterhk-smarttest/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

SmartTest
=========

[](#smarttest)

PHP Service Health Class

EN: A class to check or test web site's properties. Results will listing via true or false results of given functions.

TR: PHP ile oluşturduğunuz sitenizin özelliklerini test etmenizi kolaylaştıracak bir sınıf. Gerekli fonksiyonları tanımlayarak, fonksiyonun döndürdüğü True/False değerine göre çalışmayan özellikler rapor edilir.

How to use? / Nasıl kullanırım?
===============================

[](#how-to-use--nasıl-kullanırım)

### Installation / Kurulum

[](#installation--kurulum)

```
  require 'SmartTest.php';
  $test = SmartTest::getInstance();

```

### Check function is exist / Fonksiyon varlığını kontrol etmek:

[](#check-function-is-exist--fonksiyon-varlığını-kontrol-etmek)

```
  $test->test_function("gzip function is avaliable.", "gzcompress");

```

### Check module is exist / Modül varlığını kontrol etmek:

[](#check-module-is-exist---modül-varlığını-kontrol-etmek)

```
  $test->test_extension("php-gd module is exist.", "gd");

```

### Check file is writable / Dosya yazılabilirliğini kontrol etmek:

[](#check-file-is-writable---dosya-yazılabilirliğini-kontrol-etmek)

```
  $test->test_writable("tmp/cookie.txt file is writable.", "tmp/cookie.txt");

```

### Check file is exist / Dosyanın bulunduğunu kontrol etmek

[](#check-file-is-exist---dosyanın-bulunduğunu-kontrol-etmek)

```
  $test->test_file_exist("bootstrap-theme.css is exist.", "css/bootstrap-theme.css");

```

### Check database connection is exist / Bir fonksiyon ile veritabanı bağlantısını kontrol etmek

[](#check-database-connection-is-exist--bir-fonksiyon-ile-veritabanı-bağlantısını-kontrol-etmek)

This function is only for "Mysqli". Bu özellik sadece "Mysqli" ile bağlantı kurulurken kullanılabilir.

```
  $test->test("Veritabanı bağlantısı", function() use ($test) {
              $con = new mysqli("localhost", "username", "password", "database");
              if (mysqli_connect_errno()) {
                  $test->stop(); // Stop all test functions. Because other functions will return false.
                  return false;
              }
              return true;
          });

```

### Check response of ajax result / Ajax ile JSON dönderen bir sayfanın verisini kontrol etmek:

[](#check-response-of-ajax-result--ajax-ile-json-dönderen-bir-sayfanın-verisini-kontrol-etmek)

```
  $test->test("Kitapçı ajax", function() use ($test) {
      $response = $test->get("http://www.kitabyte.com/ajax/bookstore");
      return count($response->bookstore) > 0;
          });

```

### Check an url wia GET method / GET metodu ile bir adresi kontrol etmek:

[](#check-an-url-wia-get-method--get-metodu-ile-bir-adresi-kontrol-etmek)

```
  $test->test("Kullanıcı arama", function() use ($test) {
      $response = $test->get("http://www.kitabyte.com/");
      return count($response) > 0;
  });

```

### Check an url wia POST method / POST metodu ile bir adresi kontrol etmek:

[](#check-an-url-wia-post-method--post-metodu-ile-bir-adresi-kontrol-etmek)

```
$test->test("Post ile erişmek", function () use ($test) {
            $fields = array("field1" => "data", "field2" => 123);
            $response = $test->post("http://www.kitabyte.com/test", $fields);

            if ($response->success) {
                    return true;
                } else {
                    return false;
                }
            }
            return false;
        });

```

### To run all test functions. / Tüm testleri tanımladıktan sonra çalıştırmak için.

[](#to-run-all-test-functions--tüm-testleri-tanımladıktan-sonra-çalıştırmak-için)

```
    $test->run();

```

### Report Screen / Rapor ekranı

[](#report-screen--rapor-ekranı)

```

    Kitabyte System Health

```

[![](https://camo.githubusercontent.com/fcfa4c1d7dec444df818f741ba5f6de9149c578bc902332bd014607a640484de/687474703a2f2f692e696d6775722e636f6d2f65704b473149582e6a70673f31 "Ekran görüntüsü 1")](http://i.imgur.com/epKG1IX)
[![](https://camo.githubusercontent.com/68d68ea9c9acb59d195e8972e7c2b02ba1321b8b526afd180ca9d89b03d7a7ee/687474703a2f2f692e696d6775722e636f6d2f3331566c3931332e6a70673f31 "Ekran görüntüsü 2")](http://i.imgur.com/31Vl913)License / Lisans
================

[](#license--lisans)

Bu kaynak kod MIT lisansı ile lisanslanmıştır. This source code is licensed under MIT License.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d28630f07abb720121e82afa7137ea14526a523e4fb28cea3988aea3f78da511?d=identicon)[merterhk](/maintainers/merterhk)

---

Top Contributors

[![merterhk](https://avatars.githubusercontent.com/u/895848?v=4)](https://github.com/merterhk "merterhk (12 commits)")

### Embed Badge

![Health badge](/badges/merterhk-smarttest/health.svg)

```
[![Health](https://phpackages.com/badges/merterhk-smarttest/health.svg)](https://phpackages.com/packages/merterhk-smarttest)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M678](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M753](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M571](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.0k](/packages/orchestra-testbench)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
