Nette Pro / Magazine #0

by Honza Černý 4 years ago | Nette

We are starting something new

This article is a shortened translation of a Czech e-mail magazine. Honza started with writing some news from our community and foundation. Because we want to talk to you, no matter where you are, we have also turned this e-mail magazine into a blog post. We are planning a new article delivery in every 2–3 weeks. However, a brief delay might occur depending on a translation speed. If you'd like to help us with a content and/or corrections, contact Honza for more information. We are open for any help.

#NetteFwPivo

This Twitter hashtag stands for small repeated events and casual community meetings. An English equivalent, #NetteFwBeer, will also be used. These casual meetings take place every second Wednesday in a month. If you'd like to set up your own local community event, just create an event at http://eventle.com/(or elsewhere) and promote it on a Nette forum. We want the community to grow and this is a one of the ways how we are able to make it happen.

read more


Changes in Nette Tester 1.7.0

by Miloslav Hůla 4 years ago | Tester

Nette Tester 1.7.0 is out. I'll summarize the changes.

HtmlGenerator, which generates HTML code coverage report, now counts lines from not evaluated files as not covered. The only impact is, that you can see lower percentual coverage in report. Imagine the situation, that you have two source files (same lenght for simplification), but only one of them is loaded by tests. You got 100% coverage before, now you get only 50%.

If you are using TestCase test methods with @dataProvider, data provider method can return Traversable now. As a consequence of this, you can use generator (yield). It is handy for lazy data loading, for example from remote API. Short example:

read more


Changes in Nette Tester 1.6.0

by Miloslav Hůla 4 years ago | Tester

Nette Tester 1.6.0 is out. Let me summarize the changes.

New optional parameter $description has been added to almost all Assert methods. It works as an error message prefix when an assertion fails. It is handy in situations where the error message is not self-describing enough. For example, in a loop with assertion:

foreach ($model->getUsers() as $user) {
    Assert::true($user->isActive(), "User $user->name");
}

read more


Changes in Nette Tester 1.5.0

by Miloslav Hůla 4 years ago | Tester

The Nette Tester 1.5.0 has been released last week. It's a small release and here I bring news.

Compatibility with PHP 7 has been improved. Tester works with PHP 7 well and now it supports Throwable interface. So all PHP 7 exceptions are printed and dumped correctly. No more problems are known, if you hit some, open an issue please.

The test runner (vendor/bin/tester) now prints PHP startup errors. It may disclose problem with PHP extensions loading.

read more


Powerful Dependency Injection Container

by David Grudl 4 years ago | Nette

Nette DI (Dependency Injection Container) is one of the most interesting part of Nette Framework. It is compiled, extremely fast and easy to configure.

Let's have an application for sending newsletters. The code is maximally simplified and is available on the GitHub.

We have the object representing email:

class Mail
{
    public $subject;
    public $message;
}

read more